Appearance Settings in Windows Forms Percent TextBox

Background settings

The Background settings of the PercentTextBox control are discussed below.

Background color

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

this.percentTextBox1.BackColor = System.Drawing.Color.LightCyan;
this.percentTextBox1.ReadOnly = true;
this.percentTextBox1.ReadOnlyBackColor = System.Drawing.Color.Pink;
Me.percentTextBox1.BackColor = System.Drawing.Color.LightCyan
Me.percentTextBox1.ReadOnly = True
Me.percentTextBox1.ReadOnlyBackColor = System.Drawing.Color.Pink

PercentTextBox back color

PercentTextBox 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 PercentTextBox control are discussed below.

Foreground color

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

this.percentTextBox1.PositiveColor = System.Drawing.Color.ForestGreen;
this.percentTextBox1.NegativeColor = System.Drawing.Color.Orange;
this.percentTextBox1.ZeroColor = System.Drawing.Color.Orchid;
Me.percentTextBox1.PositiveColor = System.Drawing.Color.ForestGreen
Me.percentTextBox1.NegativeColor = System.Drawing.Color.Orange
Me.percentTextBox1.ZeroColor = System.Drawing.Color.Orchid

PercentTextBox fore 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 PercentTextBox.

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

…\My Documents\Syncfusion\EssentialStudio\Version Number\Windows\Tools.Windows\Samples\Advanced Editor Functions\ActionGroupingDemo