R
Richard
Hi,
I have a form with a picture box on it. I have set the picture box
background to black, and in the paint event for the picture box, I do:
Msgbox "In Paint Event"
PictureBox1.CreateGraphics.Clear(Color.Red)
When I run the form, the message "Paint Event" pops up and the background of
the picture box has changed to red, but when I click okay the background
reverts to black.
If I take the MsgBox out, the background stays black.
My understanding of the paint event is obviously incorrect. How do I go
about writing text or graphics to the picture box if it is going to
disappear all the time?
Also, if I open up a notepad window, and move the window around the form and
over the picture box, only certain parts of the picture box are actually
painted red. It differs depending upon how fast I move the notepad window.
Obviously, the picture box needs to be repainted perfectly every time. It's
really weird what appears to be happening.
Thanks in advance,
Richard
I have a form with a picture box on it. I have set the picture box
background to black, and in the paint event for the picture box, I do:
Msgbox "In Paint Event"
PictureBox1.CreateGraphics.Clear(Color.Red)
When I run the form, the message "Paint Event" pops up and the background of
the picture box has changed to red, but when I click okay the background
reverts to black.
If I take the MsgBox out, the background stays black.
My understanding of the paint event is obviously incorrect. How do I go
about writing text or graphics to the picture box if it is going to
disappear all the time?
Also, if I open up a notepad window, and move the window around the form and
over the picture box, only certain parts of the picture box are actually
painted red. It differs depending upon how fast I move the notepad window.
Obviously, the picture box needs to be repainted perfectly every time. It's
really weird what appears to be happening.
Thanks in advance,
Richard