Constuctor Class
constructor:
{
_pen = new Pen(_color);
_brush = new SolidBrush(Color.FromKnownColor (KnownColor.Control));
_brushInside = new SolidBrush(_color);
}
// OnPaint…
protected override void OnPaint(PaintEventArgs pe)
{
Graphics g = pe.Graphics;
g.FillRectangle(_brush,
0 , 0 , ClientSize.Width, ClientSize.Height);
g.DrawEllipse(_pen, 0,
0 , ClientSize.Width, ClientSize.Height);
g.FillEllipse(_brushInside, 0, 0 , ClientSize.Width, ClientSize.Height);
}
ON PAINTING EVENT
GraphicsPath path = new GraphicsPath();
path.AddEllipse( 0, 0, ClientSize.Width, ClientSize.Height);
this.Region = new Region(path);
No comments:
Post a Comment