Take the 2-minute tour ×

I have a picture box. This picturebox is used for map.

Map has elemenst on it. For example, a display.

I created "display" from windows user control. This user control has "a panel, 3 pictureboxes on the panel".

Any user creates "displays" on the screen and save it as a control of a picturebox (map). When any user save the data, it is saved to the database.

In every second, I look at the picturebox (map), control the data on it and also database. If "display" changed its status(like shows go or stop, kind of traffic signs), then I found the changed ones and refresh it.

Now is the question: If I remove the display(user control) than add it again to map's (picturebox) controls, it works well. Updated "display" is seen on the map. However, any user can see the process because the display is disapeared for miliseconds and come back like flickering.

How can I refresh this user control without remove and add again process, Is there a method to refresh it some way?

share|improve this question
In short, you cant, WPF ftw. –  Gustav Klimt Jan 3 '13 at 12:35
I am so sorry but I cant understand : "ftw." –  birole Jan 3 '13 at 12:36
"for the win" ^^ –  Aschratt Jan 3 '13 at 12:37
add comment

1 Answer

up vote 2 down vote accepted

To suppress any flickering, you can cheat by telling windows to suspend the parent control painting before your flicker generating operation, and resume it afterwards. Check this SO question out.

I do it quite often on my custom controls and it works great. You can even add the "SuspendDrawing" and "ResumeDrawing" static methods from the first answer as extension methods for Control class.

share|improve this answer
thank you very much for the answer, perfect result :) –  birole Jan 3 '13 at 14:55
add comment

Your Answer


