DrawingAttributes.AttributeChanged 事件

定義

DrawingAttributes 物件中的屬性變更時發生。

public:
 event System::Windows::Ink::PropertyDataChangedEventHandler ^ AttributeChanged;
public event System.Windows.Ink.PropertyDataChangedEventHandler AttributeChanged;
member this.AttributeChanged : System.Windows.Ink.PropertyDataChangedEventHandler 
Public Custom Event AttributeChanged As PropertyDataChangedEventHandler 
Public Event AttributeChanged As PropertyDataChangedEventHandler 

事件類型

PropertyDataChangedEventHandler

範例

下列範例會處理 AttributeChanged 事件。 這個範例假設有一個 DrawingAttributes 稱為 inkDA 的物件,而且 AttributeChanged 事件會連接到此範例中定義的事件處理常式。

void inkDA_AttributeChanged(object sender, PropertyDataChangedEventArgs e)
{
    if (e.PropertyGuid == DrawingAttributeIds.Color)
    {
        this.Title = "The pen color is: " + e.NewValue.ToString();
    }
}
Private Sub inkDA_AttributeChanged(ByVal sender As Object, _
                                  ByVal e As PropertyDataChangedEventArgs)

    If (e.PropertyGuid = DrawingAttributeIds.Color) Then
        Me.Title = "The pen color is: " + e.NewValue.ToString()
    End If

End Sub

適用於