FontDialog.ShowApply Property

Definition

Gets or sets a value indicating whether the dialog box contains an Apply button.

C#
public bool ShowApply { get; set; }

Property Value

true if the dialog box contains an Apply button; otherwise, false. The default value is false.

Examples

The following code example shows how to apply the selections in a FontDialog to the text in a RichTextBox. In the event handler that displays the dialog box, the example initializes the ShowApply property to true and then displays the FontDialog. In the Apply event handler, the Font property is assigned to the Control.Font property.

C#

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;
}

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also