Home All Groups Group Topic Archive Search About

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

Author
22 Aug 2006 5:20 PM
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.

Author
22 Aug 2006 7:08 PM
tlkerns
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

Show quoteHide quote
"shrestha.mah***@gmail.com" wrote:

> 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.
>
>
Author
23 Aug 2006 1:24 PM
Chris Dunaway
shrestha.mah***@gmail.com wrote:
> 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
Author
23 Aug 2006 3:44 PM
shrestha.mahesh
Thank a lot for the both responses. Form.Paint event solved the
problem.


Chris Dunaway wrote:
Show quoteHide quote
> shrestha.mah***@gmail.com wrote:
> > 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