[RESOLVED] [2005] clearing drawn lines from a form
Having now harnessed the power of drawing lines (newby :blush: ) is there a way/command to clear the form of these lines.
Im doing the following when a button is pressed to draw some lines:
Dim this_graphics As Graphics = CreateGraphics()
this_graphics.DrawLine(pens.red, point1, point2)
Cheers
Re: [2005] clearing drawn lines from a form
okay, trawling says theres a command for clearing....
g.graphics.clear(colour)
genius
Re: [RESOLVED] [2005] clearing drawn lines from a form
You're going about this the wrong way, as evidenced by the fact that you're calling CreateGraphics. Also, you're clearing a colour, which isn't clearing the lines you've drawn specifically.
Follow the GDI+ tutorial link in my signature and read their #1 FAQ question, then checkout my simple drawing program submission in the CodeBank.
http://www.vbforums.com/showthread.php?t=426684
Re: [RESOLVED] [2005] clearing drawn lines from a form
Ah, youre right, thanks for that.
Ill get reading that!
ta