Clear Graphics

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I got a simple line of code that paints on a panel. I would like to add a
clear button to clear the panel but I’m not to sure how.

Panel.MouseMove
Dim g As Graphics = Me.Panel1.CreateGraphics()
g.FillEllipse(New SolidBrush(Value), e.X, e.Y, SizePt, SizePt)
g.Dispose()

cmdClear_Click
Me.Panel.?????
 
Gus said:
I got a simple line of code that paints on a panel. I would like to add a
clear button to clear the panel but I’m not to sure how.

Panel.MouseMove
Dim g As Graphics = Me.Panel1.CreateGraphics()
g.FillEllipse(New SolidBrush(Value), e.X, e.Y, SizePt, SizePt)
g.Dispose()

cmdClear_Click
Me.Panel.?????

Use the Clear(Color) method in the Graphics class.
 
not to sure how to do the code for this any help?
--
thank You

Use the Clear(Color) method in the Graphics class.


Should be something like:

Me.Panel1.CreateGraphics().Clear(Me.Panel1.BackColor)

Thanks,

Seth Rowe
 
Gus said:
not to sure how to do the code for this any help?

Example:

Dim g As Graphics = Me.Panel1.CreateGraphics()
g.Clear(Color.Black)
g.Dispose()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top