Returns all possible font sizes of a certain font.
public string[] GetFontSizes()
Public Function GetFontSizes() As String()
public string[] GetFontSizes(string fontFamily)
Public Function GetFontSizes(ByVal Font As String) As String()
Parameter | Description |
---|---|
font |
Specifies the font the possible sizes of which are returned. It must be a font in the list of supported fonts which are returned through the Get |
The return value is the list of possible font sizes. Null is returned, if the specified font is not supported or if text is selected and the selection contains several different fonts.
The following examples in CSharp, VBNET and XAML show how to bind a combo box to the Font
private void cbFontSize_DropDownOpened(object sender, EventArgs e) {
cbFontSize.ItemsSource = textControl1.InputFormat.GetFontSizes();
}
Private Sub cbFontSize_DropDownOpened(sender As Object, e As EventArgs)
cbFontSize.ItemsSource = TextControl1.InputFormat.GetFontSizes()
End Sub
?
xmlns:tx="clr-namespace:TXTextControl.WPF;assembly=TXTextControl.WPF"
?
<Window.Resources>
<tx:MeasureConverter Unit="Point" Decimals="1" x:Key="twipsConv" />
</Window.Resources>
?
<ComboBox
Name="cbFontSize"
IsEditable="True"
IsReadOnly="True"
Width="50"
DropDownOpened="cbFontSize_DropDownOpened"
Text="{Binding
ElementName=textControl1,
Path=InputFormat.FontSize,
Converter={StaticResource twipsConv}}" />