Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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 */
public boolean get_ShowApply ()

/** @property */
public void set_ShowApply (boolean value)

public function get ShowApply () : boolean

public function set ShowApply (value : boolean)

Not applicable.

Property Value

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;
	fontDialog1.ShowDialog();
}

private 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.set_ShowApply(true);
    fontDialog1.ShowDialog();
} //button1_Click

private void fontDialog1_Apply(Object sender, System.EventArgs e)
{
    // Applies the selected font to the selected text.
    richTextBox1.set_Font(fontDialog1.get_Font());
} //fontDialog1_Apply 

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2015 Microsoft