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.

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();
        }
    }
}
Private Sub changeService_ComponentChanged( _
ByVal sender As Object, _
ByVal e As ComponentChangedEventArgs)

    If Object.ReferenceEquals( _
    e.Component, _
    Me.relatedControl) Then
        If e.Member.Name = "Margin" OrElse _
           e.Member.Name = "Padding" Then
            Me.marginAndPaddingAdorner.Invalidate()
        End If
    End If

End Sub

Invalidate()

Forces the BehaviorService to refresh its adorner window.

public:
 void Invalidate();
public void Invalidate ();
member this.Invalidate : unit -> unit
Public Sub 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.

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();
        }
    }
}
Private Sub changeService_ComponentChanged( _
ByVal sender As Object, _
ByVal e As ComponentChangedEventArgs)

    If Object.ReferenceEquals( _
    e.Component, _
    Me.relatedControl) Then
        If e.Member.Name = "Margin" OrElse _
           e.Member.Name = "Padding" Then
            Me.marginAndPaddingAdorner.Invalidate()
        End If
    End If

End Sub

See also

Applies to

Invalidate(Rectangle)

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

public:
 void Invalidate(System::Drawing::Rectangle rectangle);
public void Invalidate (System.Drawing.Rectangle rectangle);
member this.Invalidate : System.Drawing.Rectangle -> unit
Public Sub Invalidate (rectangle As Rectangle)

Parameters

rectangle
Rectangle

The area to invalidate.

See also

Applies to

Invalidate(Region)

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

public:
 void Invalidate(System::Drawing::Region ^ region);
public void Invalidate (System.Drawing.Region region);
member this.Invalidate : System.Drawing.Region -> unit
Public Sub Invalidate (region As Region)

Parameters

region
Region

The Region to invalidate.

See also

Applies to