How to make an ellipse control | SoloLearn: Learn to code for FREE!

+2

How to make an ellipse control

I tried creating an Ellipse class that inherits WinForms Control class and override OnPaint to draw ellipse. When i start the program if BackColor is a visible color, it draws a rectangle of the color of BackColor. I know it is from OnPaintBackground but if i override it, It does very strange things. Ideas? the class : class Ellipse : Control { public Ellipse {} protected override void OnPaint (PaintEventArgs pe)=> pe.Graphics.FillEllipse (new SolidBrush (BackColor), pe.ClipRectangle); }

8/8/2018 6:37:06 PM

רועי אבידן

1 Answer

New Answer

0

If you may send the code and/or its results, that would be pleasant