Display Settings in Windows Forms Integer TextBox (Integertextbox)

3 Sep 2020 / 2 minutes to read

This section discusses the display settings of the IntegerTextBox control.

The IntegerTextBox provides a list of properties to set the display characteristics associated with the integer value.

The grouping size of the number digits can be set using the Int32 Collection Editor which will be displayed on selecting the NumberGroupSizes property in the property grid.

this.integerTextBox1.NumberGroupSeparator = "/";
this.integerTextBox1.NumberGroupSizes = new int[] { 5 };
this.integerTextBox1.NumberNegativePattern = 2;
this.integerTextBox1.NegativeSign = "-";
Me.integerTextBox1.NumberGroupSeparator = "/"
Me.integerTextBox1.NumberGroupSizes = New Integer() {5}
Me.integerTextBox1.NumberNegativePattern = 2
Me.integerTextBox1.NegativeSign = "-"

Display setting

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

…_My Documents\Syncfusion\EssentialStudio\Version Number\Windows\Tools.Windows\Samples\Advanced Editor Functions\ActionGroupingDemo_

Value settings

The various values of the IntegerTextBox control and their settings are given below.

this.integerTextBox1.IntegerValue = ((long)(777));
this.integerTextBox1.DefaultValue = 0;
this.integerTextBox1.BindableValue = 777;
Me.integerTextBox1.IntegerValue = (CLng(777))
Me.integerTextBox1.DefaultValue = 0
Me.integerTextBox1.BindableValue = 777

Value setting

Null value settings

There are various settings that can be applied to the IntegerTextBox control when the value of the control is set to ‘Null’. These settings are illustrated below.

this.integerTextBox1.NullString = "Null Value";
this.integerTextBox1. AllowNull = true;
Me.integerTextBox1.NullString = "Null Value"
Me.integerTextBox1. AllowNull = True

Null value setting

Min and max value settings

The minimum and maximum values of the IntegerTextBox can be set using the below given properties.

this.integerTextBox1.MaxValue = 9223372036854775807;
this.integerTextBox1.MinValue = -9223372036854775808;
Me.integerTextBox1.MaxValue = 9223372036854775807
Me.integerTextBox1.MinValue = -9223372036854775808