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. 대화 상자를 표시하는 이벤트 처리기에서 예제에서는 속성을 true 로 초기화 ShowApply 한 다음 을 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

적용 대상

추가 정보