ToolStripItem.Invalidate メソッド

定義

ToolStripItemのサーフェスの一部またはすべてを無効にし、再描画します。

オーバーロード

名前 説明
Invalidate(Rectangle)

ToolStripItemの指定した領域をToolStripItemの更新領域 (次のペイント操作で再描画される領域) に追加して無効にし、ペイント メッセージをToolStripItemに送信します。

Invalidate()

ToolStripItemのサーフェス全体を無効にし、再描画します。

Invalidate(Rectangle)

ToolStripItemの指定した領域をToolStripItemの更新領域 (次のペイント操作で再描画される領域) に追加して無効にし、ペイント メッセージを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)

パラメーター

r
Rectangle

無効化するリージョンを表す Rectangle

適用対象

Invalidate()

ToolStripItemのサーフェス全体を無効にし、再描画します。

public:
 void Invalidate();
public void Invalidate();
member this.Invalidate : unit -> unit
Public Sub Invalidate ()

次のコード例では、カスタム レンダリングに Invalidate メソッドを使用する方法を示します。 このコード例は、 ToolStripItem クラスに提供されるより大きな例の一部です。

// 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

適用対象