Adorner.Invalidate Method

Definition

Forces the BehaviorService to refresh its adorner window.

Overloads

Invalidate()

Forces the BehaviorService to refresh its adorner window.

Invalidate(Rectangle)

Forces the BehaviorService to refresh its adorner window within the given Rectangle.

Invalidate(Region)

Forces the BehaviorService to refresh its adorner window within the given Region.

Examples

The following example demonstrates how to force an Adorner window to repaint. For a full code listing, see How to: Extend the Appearance and Behavior of Controls in Design Mode.

C#
void changeService_ComponentChanged(object sender, ComponentChangedEventArgs e)
{
    if (object.ReferenceEquals(
        e.Component, 
        this.relatedControl))
    {
        if (e.Member.Name == "Margin" ||
            e.Member.Name == "Padding" )
        {
            this.marginAndPaddingAdorner.Invalidate();
        }
    }
}

Invalidate()

Source:
Adorner.cs
Source:
Adorner.cs
Source:
Adorner.cs

Forces the BehaviorService to refresh its adorner window.

C#
public void Invalidate();

Examples

The following code example demonstrates how to force an Adorner window to repaint. For a full code listing, see How to: Extend the Appearance and Behavior of Controls in Design Mode.

C#
void changeService_ComponentChanged(object sender, ComponentChangedEventArgs e)
{
    if (object.ReferenceEquals(
        e.Component, 
        this.relatedControl))
    {
        if (e.Member.Name == "Margin" ||
            e.Member.Name == "Padding" )
        {
            this.marginAndPaddingAdorner.Invalidate();
        }
    }
}

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Invalidate(Rectangle)

Source:
Adorner.cs
Source:
Adorner.cs
Source:
Adorner.cs

Forces the BehaviorService to refresh its adorner window within the given Rectangle.

C#
public void Invalidate(System.Drawing.Rectangle rectangle);

Parameters

rectangle
Rectangle

The area to invalidate.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Invalidate(Region)

Source:
Adorner.cs
Source:
Adorner.cs
Source:
Adorner.cs

Forces the BehaviorService to refresh its adorner window within the given Region.

C#
public void Invalidate(System.Drawing.Region region);

Parameters

region
Region

The Region to invalidate.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10