TextBoxSettingsForButtonEdit in Windows Forms ButtonEdit

26 Apr 20211 minute to read

The default textbox within the ButtonEdit control can be replaced with any custom textbox like PercentTextBox, IntegerTextBox, and so on. The embedded textbox of a ButtonEdit control can shown by ShowTextBox property and customized by SelectionLength and SelectionStart properties.

ButtonEdit Properties Description
ShowTextBox Indicates whether the embedded TextBox is visible in the ButtonEdit control. This property setting can be reset to default by calling ResetShowTextBox method.
SelectionLength Sets the selection length of the embedded TextBox. This property setting can be reset to default by calling ResetSelectionLength method.
SelectionStart Sets the SelectionStart property of the ButtonEdit control which is same as the TextBoxBase.SelectionStart of the embedded TextBox. This property setting can be reset to default by calling ResetSelectionStart method.
this.buttonEdit1.SelectionLength = 1;
this.buttonEdit1.SelectionStart = 3;
this.buttonEdit1.ShowTexBox = true;
Me.buttonEdit1.SelectionLength = 1
Me.buttonEdit1.SelectionStart = 3
Me.buttonEdit1.ShowTexBox = True

NOTE

To increase the height of the ButtonEdit control, by enabling the Multiline property of ButtonEdit.TextBox.

TextBox setting in ButtonEdit