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

フォームの [確定] ボタンとして使用するボタンを表す IButtonControl

属性

注釈

このクラスでは、このプロパティは使用されません。

このプロパティを使用すると、ユーザーがアプリケーションで Enter キーを押したときに発生する既定のアクションを指定できます。 このプロパティに割り当てられるボタンは、現在のフォーム上にあるボタン、または現在のフォーム上のコンテナー内にあるボタンである必要があります IButtonControl

たとえば、このプロパティを使用すると、ユーザーがマウスで [承諾] ボタンを手動でクリックする代わりに、完了したときに Enter キーを押して簡単なフォームをすばやく移動できます。

フォームで現在選択されているコントロールが ENTER キーをインターセプトして処理する場合、同意ボタンがアクティブ化されない可能性があります。 たとえば、複数行のテキスト ボックス コントロールを使用すると、Enter キーを押すと、コントロールに新しい行文字を挿入できます。

適用対象

こちらもご覧ください