FontDialog.ShowApply プロパティ

定義

ダイアログ ボックスに [適用] ボタンを表示するかどうかを示す値を取得または設定します。

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

プロパティ値

true ダイアログ ボックスに [適用 ] ボタンが含まれている場合は 。それ以外の場合は false。 既定値は false です。

次のコード例は、 の選択範囲を 内 FontDialog のテキストに適用する方法を RichTextBox示しています。 ダイアログ ボックスを表示するイベント ハンドラーで、 プロパティを ShowApplytrue 初期化し、 FontDialogを表示します。 Applyイベント ハンドラーでは、 Font プロパティが プロパティにControl.Font割り当てられます。

private:
   void button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
   {
      // Sets the ShowApply property, then displays the dialog.
      fontDialog1->ShowApply = true;
      fontDialog1->ShowDialog();
   }

   void fontDialog1_Apply( Object^ /*sender*/, System::EventArgs^ /*e*/ )
   {
      // Applies the selected font to the selected text.
      richTextBox1->Font = fontDialog1->Font;
   }

private void button1_Click(object sender, System.EventArgs e)
{
    // Sets the ShowApply property, then displays the dialog.

    fontDialog1.ShowApply = true;
    fontDialog1.ShowDialog();
}

private void fontDialog1_Apply(object sender, System.EventArgs e)
{
    // Applies the selected font to the selected text.
    richTextBox1.Font = fontDialog1.Font;
}
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    ' Sets the ShowApply property, then displays the dialog.
    FontDialog1.ShowApply = True
    FontDialog1.ShowDialog()

End Sub

Private Sub FontDialog1_Apply(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FontDialog1.Apply

    ' Applies the selected font to the selected text.
    RichTextBox1.SelectionFont = FontDialog1.Font

End Sub

適用対象

こちらもご覧ください