TXTextControl.InputFormat.FontFamily Property

Gets or sets the font family at the current input position. If text is selected, the property specifies the font family of the whole selected text.

Syntax

[C#]
public string FontFamily { get; set; }
[Visual Basic]
Public Property FontFamily() As String

Remarks

The property returns null when the text selection contains multiple characters with mixed font names.

Example

The following XAML example shows how to bind a combo box to the FontFamily property using GetFontFamilies to fill the combo box with available font names.

<ComboBox
   Name="cbFontFamily"
   IsEditable="True"
   IsReadOnly="True"
   Width="150"
   DropDownOpened="cbFontFamily_DropDownOpened"
   Text="{Binding ElementName=textControl1, Path=InputFormat.FontFamily}" />
[C#]
private void cbFontFamily_DropDownOpened(object sender, EventArgs e) {
   cbFontFamily.ItemsSource = textControl1.InputFormat.GetFontFamilies();
}
[Visual Basic]
Private Sub cbFontFamily_DropDownOpened(sender As Object, e As EventArgs)
   cbFontFamily.ItemsSource = textControl1.InputFormat.GetFontFamilies()
End Sub

See Also