By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,065 Members | 1,598 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,065 IT Pros & Developers. It's quick & easy.

Redraw/repaint a PictureBox control

P: n/a
Can someone tell me how you go about handling events where your window
might be obscured and then when you bring it to the foreground, you want
your picturebox control to be repainted instead of showing large,
blocked out areas created by overlapping windows.

I have seen numerous references to onpaint etc but I haven't found an
example to follow or at least my own efforts with onpaint haven't been
fruitful as yet.
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Tyson Ackland wrote:
Can someone tell me how you go about handling events where your window
might be obscured and then when you bring it to the foreground, you want
your picturebox control to be repainted instead of showing large,
blocked out areas created by overlapping windows.

I have seen numerous references to onpaint etc but I haven't found an
example to follow or at least my own efforts with onpaint haven't been
fruitful as yet.


OK I have worked out the repainting is working when resizing the window
and maximise/restoring the window. This is all happening via my Paint
handler for the PictureBox.

What is not working though is restoring from a minimised/iconified
state. The restored window does not show my PictureBox piccy. Does
anyone know what handler I need to use for this event?
Nov 20 '05 #2

P: n/a
Form_OnPaint()
Depending on the complexity of your drawing requirements, most repainting
can be done from the OnPaint event.
____________________________
The Grim Reaper

"Tyson Ackland" <ty*******@hotmail.com> wrote in message
news:u8**************@TK2MSFTNGP12.phx.gbl...
Tyson Ackland wrote:
Can someone tell me how you go about handling events where your window
might be obscured and then when you bring it to the foreground, you want
your picturebox control to be repainted instead of showing large,
blocked out areas created by overlapping windows.

I have seen numerous references to onpaint etc but I haven't found an
example to follow or at least my own efforts with onpaint haven't been
fruitful as yet.


OK I have worked out the repainting is working when resizing the window
and maximise/restoring the window. This is all happening via my Paint
handler for the PictureBox.

What is not working though is restoring from a minimised/iconified
state. The restored window does not show my PictureBox piccy. Does
anyone know what handler I need to use for this event?

Nov 20 '05 #3

P: n/a
Tyson Ackland wrote:
Tyson Ackland wrote:
Can someone tell me how you go about handling events where your window
might be obscured and then when you bring it to the foreground, you
want your picturebox control to be repainted instead of showing large,
blocked out areas created by overlapping windows.

I have seen numerous references to onpaint etc but I haven't found an
example to follow or at least my own efforts with onpaint haven't been
fruitful as yet.

OK I have worked out the repainting is working when resizing the window
and maximise/restoring the window. This is all happening via my Paint
handler for the PictureBox.

What is not working though is restoring from a minimised/iconified
state. The restored window does not show my PictureBox piccy. Does
anyone know what handler I need to use for this event?


Oops, I have fixed it now, looks like I had to use the argument in the
Pain event header rather than directly referencing my image variable.
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.