InvalidateEventArgs 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供 Invalidated 事件的資料。
public ref class InvalidateEventArgs : EventArgs
public class InvalidateEventArgs : EventArgs
type InvalidateEventArgs = class
inherit EventArgs
Public Class InvalidateEventArgs
Inherits EventArgs
- 繼承
範例
下列程式代碼範例示範此類型的用法。 在這個例子中,事件處理者會回報事件 Invalidated 的發生情況。 此報告能幫助您了解事件發生時間,並協助除錯。 若要報告多個事件或頻繁發生的事件,請考慮將Show訊息替換Console.WriteLine為或附加於多行TextBox。
要執行範例程式碼,將它貼到包含繼承自 Control的型別實例的專案中,例如 a Button 或 ComboBox。 接著命名實例 Control1 ,並確保事件處理程序與事件 Invalidated 相關聯。
private void Control1_Invalidated(Object sender, InvalidateEventArgs e) {
System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "InvalidRect", e.InvalidRect );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "Invalidated Event" );
}
Private Sub Control1_Invalidated(sender as Object, e as InvalidateEventArgs) _
Handles Control1.Invalidated
Dim messageBoxVB as New System.Text.StringBuilder()
messageBoxVB.AppendFormat("{0} = {1}", "InvalidRect", e.InvalidRect)
messageBoxVB.AppendLine()
MessageBox.Show(messageBoxVB.ToString(),"Invalidated Event")
End Sub
備註
當控制項的顯示更新時,事件 Invalidated 就會發生。 A InvalidateEventArgs 指定包含無效視窗區域的矩形。
關於事件模型的資訊,請參見 處理與提升事件。
建構函式
| 名稱 | Description |
|---|---|
| InvalidateEventArgs(Rectangle) |
初始化 InvalidateEventArgs 類別的新執行個體。 |
屬性
| 名稱 | Description |
|---|---|
| InvalidRect |
得到 Rectangle 包含無效視窗區域的那個。 |
方法
| 名稱 | Description |
|---|---|
| Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
| GetHashCode() |
做為預設哈希函式。 (繼承來源 Object) |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| ToString() |
傳回表示目前 物件的字串。 (繼承來源 Object) |