Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flickering or flashing at background image of panel at runtime

Status
Not open for further replies.

angelpro

Programmer
Dec 20, 2011
6
Hello,
I have a panel with a background image and I set pictureboxes at runtime on it. So when I press the button that displays all the pictureboxes at runtime there is something like flickering or flashing which is very annoying. I tried the code to the form load event and I don't get this kind of flickering or flashing. But unfortunately I need this code to the button. Is there a way to avoid the flickering? If not would it be a better idea, to use a picturebox and not the panel, but how could I display other pictureboxes at runtime onto a picturebox? I have tried with the parent property with no effect. It seems like the picture boxes are displaying back of the picturebox. What can I do? Any help will be much appreciated.
 
Take a look at the BeginUpdate and EndUpdate event handlers for the controls you are working with.

You can disable Screen Updating when you begin an update and then re-enable it when the updating is done.

This should allow the controls to update, but the UI will not be trying to redraw them until you tell them you are done updating.

I don't have any code sample for you right now (not at my desk), but you should be able to web search this without too much trouble.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
C#.NET Programmer
 
Thank you so much Postmstrmage1768 but thereisn't such a method for panel control. I found only beginupdate method to the form but with no effect. It doesn't help me at all :(
 
Please I can't find a solution.
I have a panel in my form and I create 64 (8x8) picture boxes at runtime and putting them onto panel when I click a button, and they cover all over the panel as I want. Every picture box has backcolor too except it's image. I tried to change the form backcolor to blue and when I run the application and press the button I see this flickering on the upper left point of the form and it's blue flickering as the form backcolour. Please, any help will be much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top