Button.IsCancel 屬性

定義

取得或設定值,這個值表示 Button 是否為 [取消] 按鈕。 使用者按一下 ESC 鍵,就可以啟用 [取消] 按鈕。

public:
 property bool IsCancel { bool get(); void set(bool value); };
public bool IsCancel { get; set; }
member this.IsCancel : bool with get, set
Public Property IsCancel As Boolean

屬性值

如果 Button 是 [取消] 按鈕,則為 true,否則為 false。 預設為 false

範例

下列範例示範如何使用這個屬性來建立 [取消] 按鈕。

<Button Name="btnCancel" IsCancel="true" Click="OnClickCancel">Cancel</Button>

備註

當您將 IsCancel 按鈕的 屬性設定為 true 時,您會建立 Button 向 註冊的 AccessKeyManager 。 然後,當使用者按下 ESC 鍵時,就會啟動按鈕。

相依性屬性資訊

識別碼欄位 IsCancelProperty
設定為 的中繼資料屬性 true

適用於