Hi,
I need to create a Ellipse shaped user control which have folloiwng
attributes:
1) The edges are smooth
2) The control shuld only be selected when click on the ellipse shape & not
when click on the empty area of Client Rectangle
What I have done so far:
I override the OnPaintMethod as below:
protected override OnPaint(PaintEventArgs e)
{
e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
e.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
/*
Code to Draw Ellipse using Graphics Path
*/
//graphicsPath = Path on which Ellipse has been added
this.Region = new Region(graphicsPath)
}
Now if I uses the Code - this.Region = new Region(graphicsPath) - the
ellipse get distorted over its edges & if I remove the Code - this.Region =
new Region(graphicsPath) - I got a very smooth edged ellipse, however now the
ellipse shaped user control can be selected on the designer even by clicking
on the empty area of Client Rectangle.
I would be heartly thankful, if someone can give an idea to achieve both of
the above things - Smoothness & Restricted Selection - simultaneously.
Thanks in Anticipation,
Best Regards,
Pankaj gaur