Groups | Blog | Home
all groups > dotnet drawing api > november 2003 >

dotnet drawing api : Control.Invalidate()?


John
11/30/2003 8:52:15 AM
Hi,

What is the best way to invalidate just an area of a
control??, I am currently using Control.Invalidate but I
don't want to invalidate all the control just a certain
area?, what is actually raised when you do a
Control.Invalidate(Rectangle)?

Eric Cadwell
12/1/2003 10:08:28 AM
When you Invalidate(Rectangle) the ClipRectangle of the PaintEventArgs will
contain the area of the control that needs repainting.

protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
ControlPaint.DrawBorder(e.Graphics, e.ClipRectangle, Color.Red,
ButtonBorderStyle.Dashed);
}

HTH;
Eric Cadwell
http://www.origincontrols.com

AddThis Social Bookmark Button