Colors in Xamarin NumericUpDown (SfNumericUpDown)

29 Sep 20232 minutes to read

You can customize the SfNumericUpDown background, text, and border colors using the following bindable properties:

  • TextColor - Sets the color of NumericUpDown’s value

  • BackgroundColor - Sets the background color of NumericUpDown.

  • BorderColor - Sets the border color of NumericUpDown control.

  • WatermarkColor - Sets the color of NumericUpDown’s watermark text.

Text color support in SfNumericUpDown

The following code sample demonstrates how to set the text color in XAML and in C#:

<numeric:SfNumericUpDown Value="123" TextColor="Green" />
SfNumericUpDown NumericUpDown = new SfNumericUpDown();
NumericUpDown.TextColor = Color.Green;
NumericUpDown.Value = 123;
this.Content = NumericUpDown;

Display the NumericUpDown with TextColor

Background color support in SfNumericUpDown

The following code sample demonstrates how to set the background color in XAML and in C#:

<numeric:SfNumericUpDown Value="123" BackgroundColor="Maroon" TextColor="White"/>
SfNumericUpDown NumericUpDown = new SfNumericUpDown();
NumericUpDown.BackgroundColor = Color.Maroon;
NumericUpDown.TextColor = Color.White;
NumericUpDown.Value = 123;
this.Content = NumericUpDown;

Display the NumericUpDown with BackgroundColor

Border color support in SfNumericUpDown

The following code sample demonstrates how to set the border color color in XAML and in C#:

<numeric:SfNumericUpDown Value="123" BorderColor="Red" />
SfNumericUpDown NumericUpDown=new SfNumericUpDown();
NumericUpDown.BorderColor = Color.Red;
NumericUpDown.Value = 123;
this.Content = NumericUpDown;

Display the NumericUpDown with BorderColor

Watermark color support in SfNumericUpDown

The following code sample demonstrates how to set the watermark color in XAML and in C#:

<numeric:SfNumericUpDown AllowNull="true" Watermark="NumericUpDown" WatermarkColor="Blue" />
SfNumericUpDown NumericUpDown = new SfNumericUpDown();
NumericUpDown.WatermarkColor = Color.Blue;
NumericUpDown.Watermark = "NumericUpDown";
NumericUpDown.AllowNull = true;
this.Content = NumericUpDown;

Display the NumericUpDown with WatermarkColor

See also

How to customize the color appearance of SfNumericUpDown