Problem with Graphics

I don't understand why this doesn't work:


Dim gAs System.Drawing.Graphics

g.DrawLine(Pens.Blue, 1, 1, 100, 100)


[535 byte] By [Keegan7] at [2008-2-12]
# 1
I don't see where you have set g to an instance of Graphics. Usually you use a Graphics inside a Paint event handler (where the graphics object is in PaintEventArgs parameter) or you can create a Graphics object using the CreateGraphics method of a Control/Form.
MikeDanes at 2007-9-8 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...
# 2
Thanks a lot that worked :)
Keegan7 at 2007-9-8 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...