NumberFormats Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Returns an array of all supported number formats for numbered and structured lists. This property can be used to fill a combo box or a menu.
Syntax
public NumberFormat[] NumberFormats { get; }Public ReadOnly Property NumberFormats As NumberFormat()Members
| Value | Description |
|---|---|
| ArabicNumbers | The list is numbered with Arabic numbers (1, 2, 3...). |
| Letters | The list is numbered with letters (a, b, c...). |
| CapitalLetters | The list is numbered with capital letters (A, B, C...). |
| RomanNumbers | The list is numbered with Roman numbers (I, II, III...). |
| SmallRomanNumbers | The list is numbered with small Roman numbers (i, ii, iii...). |
Examples
The following XAML example shows how to bind radio buttons to the NumberedListFormat property using the WPF.BooleanConverter class and the NumberFormats property.
…
xmlns:tx="clr-namespace:TXTextControl.WPF;assembly=TXTextControl.WPF"
…
<Window.Resources>
<tx:BooleanConverter x:Key="boolConv" />
</Window.Resources>
…
<RadioButton
Content="{Binding ElementName=textControl1, Path=InputFormat.NumberFormats[0], Mode=OneTime}"
GroupName="numberFormat"
IsChecked="{Binding
ElementName=textControl1,
Path=InputFormat.NumberedListFormat,
Converter={StaticResource boolConv},
ConverterParameter=ArabicNumbers}" />
<RadioButton
Content="{Binding ElementName=textControl1, Path=InputFormat.NumberFormats[1], Mode=OneTime}"
GroupName="numberFormat"
IsChecked="{Binding
ElementName=textControl1,
Path=InputFormat.NumberedListFormat,
Converter={StaticResource boolConv},
ConverterParameter=Letters}" />
…The following example changes the formatting applied to text entered at the end of a document by using InputFormat.NumberFormats.
textControl.Text = "Project summary";
textControl.InputPosition = new InputPosition(textControl.Text.Length);
InputFormat inputFormat = textControl.InputFormat;
foreach (NumberFormat numberFormat in inputFormat.NumberFormats)
{
Console.WriteLine(numberFormat);
}textControl.Text = "Project summary"
textControl.InputPosition = New InputPosition(textControl.Text.Length)
Dim inputFormat As InputFormat = textControl.InputFormat
For Each numberFormat As NumberFormat In inputFormat.NumberFormats
Console.WriteLine(numberFormat)
NextLimitations
Read only.