i am trying to draw a line between two points
like this:
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Graphics MyGraphics = e.Graphics;
Pen NewPen = new Pen(Color.Red,5);
MyGraphics.DrawLine(NewPen,StartDraw,EndDraw);
}
it gives me an error:
Object reference not set to an instance of an object.
what have i done wrong ?