Quote Originally Posted by salmanmanekia View Post
actually i am repainting continuously because i want to draw a progress bar which moves continuously
There is no such thing as doing something continuously in computers. Everything is digitized and quantified.

but if the button is clicked then i want that progress bar to stop there and instead draw a progress status which means repaint again...
so how to solve this ..??
When you change the value of the progress bar, call update(). When you click the button - call update(). Never call update in other circumstances. Remember to allow events to be processed in the meantime.