ToolStripItem.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.
Invalidates some or all of the surface of the ToolStripItem and causes it to be redrawn.
Invalidate(Rectangle) |
Invalidates the specified region of the ToolStripItem by adding it to the update region of the ToolStripItem, which is the area that will be repainted at the next paint operation, and causes a paint message to be sent to the ToolStripItem. |
Invalidate() |
Invalidates the entire surface of the ToolStripItem and causes it to be redrawn. |
- Source:
- ToolStripItem.cs
- Source:
- ToolStripItem.cs
- Source:
- ToolStripItem.cs
Invalidates the specified region of the ToolStripItem by adding it to the update region of the ToolStripItem, which is the area that will be repainted at the next paint operation, and causes a paint message to be sent to the ToolStripItem.
public:
void Invalidate(System::Drawing::Rectangle r);
public void Invalidate (System.Drawing.Rectangle r);
member this.Invalidate : System.Drawing.Rectangle -> unit
Public Sub Invalidate (r As Rectangle)
Parameters
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 |
- Source:
- ToolStripItem.cs
- Source:
- ToolStripItem.cs
- Source:
- ToolStripItem.cs
Invalidates the entire surface of the ToolStripItem and causes it to be redrawn.
public:
void Invalidate();
public void Invalidate ();
member this.Invalidate : unit -> unit
Public Sub Invalidate ()
Examples
The following code example demonstrates how to use the Invalidate method for custom rendering. This code example is part of a larger example provided for the ToolStripItem class.
// This method defines the behavior of the MouseEnter event.
// It sets the state of the rolloverValue field to true and
// tells the control to repaint.
protected override void OnMouseEnter(EventArgs e)
{
base.OnMouseEnter(e);
this.rolloverValue = true;
this.Invalidate();
}
' This method defines the behavior of the MouseEnter event.
' It sets the state of the rolloverValue field to true and
' tells the control to repaint.
Protected Overrides Sub OnMouseEnter(e As EventArgs)
MyBase.OnMouseEnter(e)
Me.rolloverValue = True
Me.Invalidate()
End Sub
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 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: