Appearance Settings in Windows Forms Integer TextBox (Integertextbox)

Background settings

The background settings of the IntegerTextBox control are discussed below.

Background color

The background color of the control can be set using the properties given below.

this.integerTextBox1.BackColor = System.Drawing.Color.PeachPuff;
this.integerTextBox1.ReadOnly = true;
this.integerTextBox1.ReadOnlyBackColor = System.Drawing.Color.LavenderBlush;
Me.integerTextBox1.BackColor = System.Drawing.Color.PeachPuff
Me.integerTextBox1.ReadOnly = True
Me.integerTextBox1.ReadOnlyBackColor = System.Drawing.Color.LavenderBlush

IntegerTextBox back color

IntegerTextBox read only back color

NOTE

 The ReadOnly property must be set to ‘True’ for the above setting to take effect.

The methods associated with the above properties are given below.

Foreground settings

The foreground settings of the IntegerTextBox control are discussed below.

Foreground color

The foreground color of the control can be set using the properties given below.

this.integerTextBox1.PositiveColor = System.Drawing.Color.DarkOrange;
this.integerTextBox1.NegativeColor = System.Drawing.Color.SteelBlue;
this.integerTextBox1.ZeroColor = System.Drawing.Color.OliveDrab;
Me.integerTextBox1.PositiveColor = System.Drawing.Color.DarkOrange

Me.integerTextBox1.NegativeColor = System.Drawing.Color.SteelBlue

Me.integerTextBox1.ZeroColor = System.Drawing.Color.OliveDrab

Foreground color

The methods associated with the above properties are given below.

  • ResetForeColor
  • ResetPositiveColor
  • ResetNegativeColor
  • ResetZeroColor
  • SetControlColor
  • ShouldSerializePositiveColor
  • ShouldSerializeNegativeColor
  • ShouldSerializeZeroColor

Visual style

Please refer the TextBoxExt Visual style to set themes for IntegerTextBox.

A sample which demonstrates the Foreground Settings of IntegerTextBox control is available in the below sample installation path.

…\System Drive:\Users\Username\AppData\Local\Syncfusion\EssentialStudio\Version Number\Windows\Tools.Windows\Samples\Editor Controls\Editor Controls\CS