Adorner.Invalidate Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Forces the BehaviorService to refresh its adorner window.
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. |
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
- Source:
- Adorner.cs
- Source:
- Adorner.cs
- Source:
- Adorner.cs
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
.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 |
- Source:
- Adorner.cs
- Source:
- Adorner.cs
- Source:
- Adorner.cs
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
.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 |
- Source:
- Adorner.cs
- Source:
- Adorner.cs
- Source:
- Adorner.cs
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
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 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: