repaint issue

ramanaths

Member
Joined
May 31, 2005
Messages
19
Programming Experience
Beginner
hi

i hv this is application that works similar to a graph and it shows blocks of data one below the other in rectangular boxes of varying sizes and colors. the data and lines are all drawn on a panel using the paint method. there is a vertical scroll bar and the corresponding data is painted when moving up or down.

the issue i face is when i open another window (for eg: calculator) on top of this application. when i drag the calculator around the screen, the application starts to repaint and trailing lines of the calculator appear all over.:eek: it takes few seconds before the application repaints and the calculator trail lines disapper....:mad:

how can i 'disable' the application window when it loses focus?:confused:
 
You don't have to 'disable it'. An idea could be to use the paint code only when you load the form, when it regains focus, and when you scroll the panel. Try removing the Panel.Paint code from your app, and put it into the Form.Load part. That should be it.
If you use colors with alpha transparency, keep your code, but change the color to something 100% opaque.
 
Back
Top