public Invalidate ( |
||
rc | ||
invalidateChildren | bool | |
return | void |
public void Invalidate (Rectangle rc, bool invalidateChildren)
{
// Win32 invalidates control including when Width and Height is equal 0
// or is not visible, only Paint event must be care about this.
if (!IsHandleCreated)
return;
if (rc.IsEmpty)
rc = ClientRectangle;
if (rc.Width > 0 && rc.Height > 0)
{
NotifyInvalidate (rc);
NSViewForControl.SetNeedsDisplayInRect (rc);
if (invalidateChildren)
{
Control[] controls = child_controls.GetAllControls ();
for (int i = 0; i < controls.Length; i++)
controls[i].Invalidate ();
}
else
{
// If any of our children are transparent, we
// have to invalidate them anyways
foreach (Control c in Controls)
if (c.BackColor.A != 255)
c.Invalidate ();
}
}
OnInvalidated (new InvalidateEventArgs (rc));
}
Control::Invalidate ( ) : void | |
Control::Invalidate ( |
|
Control::Invalidate ( |
|
Control::Invalidate ( |
|
Control::Invalidate ( bool invalidateChildren ) : void |
public CloseBox(Control host) { this.host = host; host.Resize += delegate { host.Invalidate(); }; host.MouseLeave += delegate { hover = false; host.Invalidate(); }; host.MouseMove += delegate(object sender, MouseEventArgs e) { bool h = bounds.Contains(e.Location); if (hover != h) { hover = h; host.Invalidate(); } }; host.MouseUp += delegate(object sender, MouseEventArgs e) { if (bounds.Contains(e.Location) && e.Button == MouseButtons.Left) Clicked(); }; }