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

適用於