-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPanelBorderRounded.cs
47 lines (40 loc) · 1.24 KB
/
PanelBorderRounded.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
namespace pControlsDev.Painel
{
public partial class PanelBorderRounded : Panel
{
/// <summary>
/// Define o valor para a borda, quando maior o valor mais vai arredondar a borda
/// </summary>
[Category("PanelRounded")]
public float _RADIUS { get; set; }
[Category("PanelRounded")]
public Color _background { get; set; }
public PanelBorderRounded()
{
InitializeComponent();
_RADIUS = 10;
_background = SystemColors.ButtonFace;
}
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
g.SmoothingMode = SmoothingMode.AntiAlias;
g.FillRoundedRectangle(new SolidBrush(_background),
0, 0, this.Width, this.Height, _RADIUS);
}
protected override void OnResize(EventArgs eventargs)
{
this.Invalidate();
}
}
}