ComponentChangedEventArgs 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供 ComponentChanged 事件的資料。 此類別無法獲得繼承。
public ref class ComponentChangedEventArgs sealed : EventArgs
public sealed class ComponentChangedEventArgs : EventArgs
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class ComponentChangedEventArgs : EventArgs
type ComponentChangedEventArgs = class
inherit EventArgs
[<System.Runtime.InteropServices.ComVisible(true)>]
type ComponentChangedEventArgs = class
inherit EventArgs
Public NotInheritable Class ComponentChangedEventArgs
Inherits EventArgs
- 繼承
- 屬性
範例
下列範例示範如何建立 ComponentChangedEventArgs。
public:
// This example method creates a ComponentChangedEventArgs using the specified arguments.
// Typically, this type of event args is created by a design mode subsystem.
ComponentChangedEventArgs^ CreateComponentChangedEventArgs( Object^ component, MemberDescriptor^ member, Object^ oldValue, Object^ newValue )
{
// Creates a component changed event args with the specified arguments.
ComponentChangedEventArgs^ args = gcnew ComponentChangedEventArgs( component, member, oldValue, newValue );
// The component that has changed: args->Component
// The member of the component that changed: args->Member
// The old value of the member: args->oldValue
// The new value of the member: args->newValue
return args;
}
// This example method creates a ComponentChangedEventArgs using the specified arguments.
// Typically, this type of event args is created by a design mode subsystem.
public ComponentChangedEventArgs CreateComponentChangedEventArgs(object component, MemberDescriptor member, object oldValue, object newValue)
{
// Creates a component changed event args with the specified arguments.
ComponentChangedEventArgs args = new ComponentChangedEventArgs(component, member, oldValue, newValue);
// The component that has changed: args.Component
// The member of the component that changed: args.Member
// The old value of the member: args.oldValue
// The new value of the member: args.newValue
return args;
}
' This example method creates a ComponentChangedEventArgs using the specified arguments.
' Typically, this type of event args is created by a design mode subsystem.
Public Function CreateComponentChangedEventArgs(ByVal component As Object, ByVal member As MemberDescriptor, ByVal oldValue As Object, ByVal newValue As Object) As ComponentChangedEventArgs
' Creates a component changed event args with the specified arguments.
Dim args As New ComponentChangedEventArgs(component, member, oldValue, newValue)
' The component that has changed: args.Component
' The member of the component that changed: args.Member
' The old value of the member: args.oldValue
' The new value of the member: args.newValue
Return args
End Function
備註
ComponentChangedEventArgs 提供事件的數據 ComponentChanged 。 事件 ComponentChanged 會 IComponentChangeService 通知 和 已註冊的事件處理程式,目前使用中檔的特定元件已變更。
提供 ComponentChangedEventArgs 下列資訊:
元件設計工具通常會在新增、移除或修改元件時自動引發 ComponentChanged 事件。 ComponentChanged表單載入和卸除期間不會引發事件,因為目前預期會有變更。 元件設計工具可能會在變更元件的 屬性之後引發 ComponentChanged 事件;這可確保 屬性視窗 會顯示更新的屬性。
給繼承者的注意事項
如果這個類別指定為另一個類別的基類,就會發生編譯程序錯誤。
建構函式
ComponentChangedEventArgs(Object, MemberDescriptor, Object, Object) |
初始化 ComponentChangedEventArgs 類別的新執行個體。 |
屬性
Component |
取得已修改的元件。 |
Member |
取得已變更的成員。 |
NewValue |
取得已變更成員的新值。 |
OldValue |
取得已變更成員的舊值。 |
方法
Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
GetHashCode() |
做為預設雜湊函式。 (繼承來源 Object) |
GetType() |
取得目前執行個體的 Type。 (繼承來源 Object) |
MemberwiseClone() |
建立目前 Object 的淺層複製。 (繼承來源 Object) |
ToString() |
傳回代表目前物件的字串。 (繼承來源 Object) |