'System.EventArgs' does not contain a definition for 'Graphics' and no extension method 'Graphics' accepting a first argument of type 'System.EventArgs' could be found (are you missing a using directive or an assembly reference?).
this error was occured when i was using graphics in button click event
please help me with this error
my requirement: when i click the button some graphics(eg: ellipse) should be drawn
Thnk you.
What I have tried:
private void btnsadsmile_Click(object sender, EventArgs e)
{
Graphics g = e.Graphics;// here the error occurs no definition for graphics
Pen p = new Pen(Color.RosyBrown, width: 3);
int w = this.ClientSize.Width;
int h = this.ClientSize.Height;
g.DrawEllipse(p, w / 3 + 67, h / 3 + 50, 20, 10);
}