Font Settings in Xamarin Numeric Entry (SfNumericTextBox)

11 Sep 20231 minute to read

SfNumericTextBox has the following two font-related properties that display the Value text:

You can customize the font style of SfNumericTextBox by using the following properties.

  • FontSize : Sets the font size for SfNumericTextBox text.

  • FontAttributes : Sets the style of SfNumericTextBox text. You can apply three types of style on it. It is specifying style information like Italic and Bold (using the FontAttributes enumeration in C#).

    1. Bold - The font is bold.
    2. Italic – The font is Italic.
    3. None – The font is unmodified.

NOTE

Default value is None.

  • FontFamily : Customizes the font family of the SfNumericTextBox text.

  • TextAlignment : Sets the style of SfNumericTextBox text. You can apply three types of style on it. It is specifying style information like Start, End, and Center (using the TextAlignment enumeration in C#).

NOTE

Default value is [Start].

To set the font size and attributes in XAML as well as in C#:

<syncfusion:SfNumericTextBox FontSize="27" FontAttributes="Bold" Value="123" TextAlignment="End" />
SfNumericTextBox numericTextBox=new SfNumericTextBox();
numericTextBox.FontSize = 27;
numericTextBox.Value = 123;
numericTextBox.TextAlignment=TextAlignment.End;
numericTextBox.FontAttributes = FontAttributes.Bold;
this.Content = numericTextBox;

Display SfNumericTextBox control with TextAlignment

See also

How to customize the font in SfNumericTextBox