FontDialog Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesWindows. Forms. dll
Description
Invokes the built-in dialog box for setting fonts and character attributes.
Syntax
FontDialog()
Opens the dialog box showing the last opened tab.
public System.Windows.Forms.DialogResult FontDialog();Public Function FontDialog() As System.Windows.Forms.DialogResultFontDialog(int)
Opens the dialog box showing the specified tab.
public System.Windows.Forms.DialogResult FontDialog(int activeTab);Public Function FontDialog(activeTab As Integer) As System.Windows.Forms.DialogResult| Parameter | Description |
|---|---|
| activeTab | Specifies the index of the tab, zero-based, that is displayed when the tabbed dialog box is opened. If this parameter is 0, the dialog box shows the tab for selecting a font and its attributes, and if this parameter is 1, the dialog box shows the tab for setting the baseline position and further text effects. |
Return Value
If the dialog has been left with the Cancel button the return value is DialogResult.Cancel. Otherwise, it is DialogResult.OK.
Examples
The following example opens the font dialog for the text control.
var result = textControl.FontDialog(10);
Console.WriteLine($"Font Dialog result: {result}");Dim result = textControl.FontDialog(10)
Console.WriteLine($"Font Dialog result: {result}")