Paint event problem

R

Rene

Currently, the paint even will only acknowledge painting going on inside of
the ClipRectangle, any of the drawing that is outside of the ClipRectangle
is ignored.



How can I get the paint event to redraw Everything?



I know that I could use the Refresh method or call the Invalidate method
with a parameter that will force a total redraw, but my problem happens when
the paint event is triggered automatically due to things such as the user
moving the form outside the desktop area or moving another form on top of
mine. This will trigger the Paint event and I have no control over the
ClipRectangle!! Please help me!!



Thank you.
 
J

Jon Skeet [C# MVP]

Rene said:
Currently, the paint even will only acknowledge painting going on inside of
the ClipRectangle, any of the drawing that is outside of the ClipRectangle
is ignored.

That's the whole point of the ClipRectangle.
How can I get the paint event to redraw Everything?

Provoke something which calls Paint with a full clip rectangle.
I know that I could use the Refresh method or call the Invalidate method
with a parameter that will force a total redraw

And you could do that from the Paint method, if you're careful to make
sure you don't end up in an infinite painting loop.
but my problem happens when
the paint event is triggered automatically due to things such as the user
moving the form outside the desktop area or moving another form on top of
mine. This will trigger the Paint event and I have no control over the
ClipRectangle!! Please help me!!

The idea is that only the portion of the screen which needs redrawing
gets redrawn. Why do you need to redraw other parts of the screen?
 
R

Rene

The idea is that only the portion of the screen which needs redrawing
gets redrawn. Why do you need to redraw other parts of the screen?

Its amazing how one can come up with a solution to a problem 1 microsecond
after posting the question. The reason why I wanted to have this behavior
was just a hack because of some things that I was doing with the
Control.ReversibleLine function but don't needed anymore.


Boy, I hope the next version of .Net supports XOR drawing, this reversible
line function is just a pain in the neck.



Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top