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 键以在控件中插入新行字符时按下。

适用于

另请参阅