put the area you want to invalidate on a pahodnel and call the panels invalidate method, or pass a rectangle to the Forms invalidate method.Omnibus said:Does anyone know how Invalidate(); can be applied on only part of the form in managed VC++.NET? Thanks in advance.
Can you possibly give an example code in managed VC++.NET as to how to do that?Joe Mamma said:put the area you want to invalidate on a pahodnel and call the panels invalidate method, or pass a rectangle to the Forms invalidate method.
UI find using a panel easier. no need to calculate the rectangle.
boy my typing was attrocious. I swear I wasnt drinking!Omnibus said:Can you possibly give an example code in managed VC++.NET as to how to do that?
tryOmnibus said:I cant figure out how to do that. As far as I understand from the help the rectangle should be created by something like this:
HDC hdc;
BOOL Rectangle(
hdc, // handle to DC
75, // x-coord of upper-left corner of rectangle
20, // y-coord of upper-left corner of rectangle
462, // x-coord of lower-right corner of rectangle
270 // y-coord of lower-right corner of rectangle
);
This, however, gives me
error C2078: too many initializers
error C2078: too many initializers
Rectangle rect = Rectangle(
75, // x-coord of upper-left corner of rectangle
20, // y-coord of upper-left corner of rectangle
462, // x-coord of lower-right corner of rectangle
270 // y-coord of lower-right corner of rectangle
);
controlPtr -> Invalidate(rect);
controlPtr -> Invalidate(Rectangle(75,20,462,270));
System::Drawing::Rectangle *r =
__nogc new System::Drawing::Rectangle(75,20,462,270);
ctrlPtr -> Invalidate(r);
ctrlPtr -> Invalidate(__nogc new System::Drawing::Rectangle(75,20,462,270));
System::Drawing::Rectangle *r = __nogc new System::Drawing::Rectangle(75,20,462,270);
public __value struct r;
this->Invalidate( r );
public __value struct r;Omnibus said:Thanks. Both codes compile well but with no apparent result. I also tried it like this:
Code:System::Drawing::Rectangle *r = __nogc new System::Drawing::Rectangle(75,20,462,270); public __value struct r; this->Invalidate( r );
This also compiles well but the result is again zilch.
System::Drawing::Rectangle *r = __nogc new System::Drawing::Rectangle(75,20,462,270);
this -> Invalidate(r);
Application::DoEvents();