Colors in NumericUpDown

29 Jun 20201 minute to read

SfNumericUpDown is used to set custom background, text, and border colors through the following properties:

  • TextColor - Sets the color of NumericUpDown’s value

  • BackgroundColor - Sets the background color of NumericUpDown.

  • BorderColor - Sets the border custom color of NumericUpDown

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

TextColor

The following code sample demonstrates how to set the TextColor:

  • c#
  • [C#]
    
    SfNumericUpDown numeric = new SfNumericUpDown()
    {
    	
    	TextColor = Color.Green,
    };

    Customized text color in NumericUpown

    BackgroundColor

    The following code sample demonstrates how to set the BackgroundColor:

  • c#
  • [C#]
    
    SfNumericUpDown numeric = new SfNumericUpDown()
    {
    	
    	BackgroundColor = Color.Red,
    	TextColor = Color.White,
    };

    Display the NumericUpDown with BackgroundColor

    BorderColor

    The following code sample demonstrates how to set the BorderColor color:

  • c#
  • [C#]
    
    SfNumericUpDown numeric = new SfNumericUpDown()
    {
    	
    	BorderColor = UIColor.Blue,
    };

    Display the NumericUpDown with BorderColor

    WatermarkColor

    The following code sample demonstrates how to set the WatermarkColor:

  • c#
  • [C#]
    
    SfNumericUpDown numeric = new SfNumericUpDown()
    {
    	
    	Watermark = (NSString)"Enter a Number",
    	WatermarkColor = UIColor.Blue,
    	AllowNull=true,
    };

    Display the NumericUpDown watermark text with a color