This documentation is archived and is not being maintained.

FontDialog.ShowApply Property

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

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public bool ShowApply { get; set; }

Property Value

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

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.

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

	fontDialog1.ShowApply = true;

private void fontDialog1_Apply(object sender, System.EventArgs e)
	// Applies the selected font to the selected text.
	richTextBox1.Font = fontDialog1.Font;

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0