newly exposed areas...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all

I have a picturebox on which I have drawn a series of concentric circles. If I move another window over the form with the picturebox on it, how do I set up the paint event so that only the newly exposed areas of the picturebox are redrawn and not the entire area? I believe Visual Basic 6.0 had a property called "clipcontrols" that took care of all this. VB.NET doesn't support this property, however.
 
hal said:
Hi all

I have a picturebox on which I have drawn a series of concentric
circles. If I move another window over the form with the picturebox
on it, how do I set up the paint event so that only the newly exposed
areas of the picturebox are redrawn and not the entire area? I
believe Visual Basic 6.0 had a property called "clipcontrols" that
took care of all this. VB.NET doesn't support this property,
however.

In OnPaint/Paint event, e.graphics.cliprectangle contains the rectangle that
needs to be updated.
 
* =?Utf-8?B?aGFs?= said:
I have a picturebox on which I have drawn a series of concentric
circles. If I move another window over the form with the picturebox on
it, how do I set up the paint event so that only the newly exposed areas
of the picturebox are redrawn and not the entire area? I believe Visual
Basic 6.0 had a property called "clipcontrols" that took care of all
this. VB.NET doesn't support this property, however.

In the 'Paint' event handler, you can access this rectangle with
'e.Graphics.ClipRectangle' ('e' is passed to the handler in the 2nd
parameter).
 
Back
Top