Share via


PrintPreviewDialog.AcceptButton 屬性

定義

取得或設定使用者按下 ENTER 鍵時所按下的表單上按鈕。

public:
 property System::Windows::Forms::IButtonControl ^ AcceptButton { System::Windows::Forms::IButtonControl ^ get(); void set(System::Windows::Forms::IButtonControl ^ value); };
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.IButtonControl AcceptButton { get; set; }
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.IButtonControl? AcceptButton { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.AcceptButton : System.Windows.Forms.IButtonControl with get, set
Public Property AcceptButton As IButtonControl

屬性值

,代表做為表單接受按鈕的按鈕。IButtonControl

屬性

備註

這個屬性與這個類別無關。

這個屬性可讓您指定當使用者在應用程式中按下 ENTER 鍵時所發生的預設動作。 指派給此屬性的按鈕必須是 IButtonControl 目前表單上的 ,或位於目前表單的容器內。

例如,您可以使用這個屬性,讓使用者在完成時按下 ENTER 鍵,而不是使用滑鼠手動按一下接受按鈕,讓使用者快速流覽簡單的表單。

如果表單上目前選取的控制項攔截 ENTER 鍵並處理它,則可能無法啟用接受按鈕。 例如,多行文字方塊控制項允許在選取 ENTER 鍵以在控制項中插入新行字元時按下。

適用於

另請參閱