If you create a new Windows Form, then use the event Paint.
private void Form1_Paint(object sender, PaintEventArgs e)
{
...
}
Then write your code in this method. For example :
private void Form1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawLine(new Pen(Brushes.Black, 1), 0, 0, 50, 50);
}
That code will draw a black line with width = 1, from (0,0) to (50,50)