Lines disappear when minimizing or other windows are placed on top of it.

  • Thread starter Thread starter shrestha.mahesh
  • Start date Start date
S

shrestha.mahesh

I have used System.Drawing.Graphics and Form.CreateGraphics to draw
line in my form during runtime. Everything is working fine but when
the form is minimized or some other windows are temporarily placed on
top of the form, the lines disappear.

Any help will be very much appreciated.
 
Instead of using CreateGraphics, try handling the Paint event and using the
Graphics member of the PaintEventArgs. Then do your drawing there. That way
your lines will be redrawn anytime the Form is repainted.

Tony
 
I have used System.Drawing.Graphics and Form.CreateGraphics to draw
line in my form during runtime. Everything is working fine but when
the form is minimized or some other windows are temporarily placed on
top of the form, the lines disappear.

Any help will be very much appreciated.

For additional information, please see the following link:

http://www.bobpowell.net/faqmain.htm

Be sure to check out question #1
 
Back
Top