Text Settings in MaskedEditBox

4 Feb 20252 minutes to read

This section discusses the text settings of the MaskedEditBox control.

The text associated with the MaskedEditBox control can be set and customized using the below given settings.

MaskedEditBox Properties Description
CharacterCasing Gets or sets the case of character as they are typed.It includes the below given options:

Normal,

Upper and

Lower.

TextAlign Indicates how the text should be aligned for edit controls.
SelectedText Gets or sets the selected text in the MaskedEditBox.
HideSelection Indicates that the selection should be hidden when the edit control loses focus.
ClipText Returns the clipped text without the formatting.
DrawActiveWhenDisabled Specifies if the text should be drawn active, even when disabled.
this.maskedEditBox1.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.maskedEditBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.maskedEditBox1.SelectedText = "34";
this.maskedEditBox1.HideSelection = true;
this.maskedEditBox1.ClipText = "34";
this.maskedEditBox1.DrawActiveWhenDisabled = true;
Me.maskedEditBox1.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper
Me.maskedEditBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
Me.maskedEditBox1.SelectedText = "34"
Me.maskedEditBox1.HideSelection = True
Me.maskedEditBox1.ClipText = "34"
Me.maskedEditBox1.DrawActiveWhenDisabled = True

Set the upper character casing text to WF MaskedEditBox control

Set the small character casing text to WF MaskedEditBox control

The methods associated with the above properties are given below.

Methods Description
AppendText Appends the text to the current text of a textbox.
OnCharacterCasingChanged Raises the CharacterCasingChanged event.
Cut Cuts the selected data to the clipboard.
Copy Copies the content of the NumberTextBox to the clipboard. The ClipMode property dictates what gets copied.
Paste Pastes the data in the clipboard into the NumberTextBox control.
Select Selects a range of text in the TextBox.

Clip mode

The formatting for the text can be enabled or disabled using the property given below.

MaskedEditBox Property Description
ClipMode Specifies the format of the text that will be returned by the MaskedEditBox control.It includes the below given options:

IncludeLiterals and

ExcludeLiterals.

this.maskedEditBox1.ClipMode = Syncfusion.Windows.Forms.Tools.ClipModes.IncludeLiterals;
Me.maskedEditBox1.ClipMode = Syncfusion.Windows.Forms.Tools.ClipModes.IncludeLiterals

OverflowIndicatorToolTipText

The tooltip that should be displayed when an overflow of text occurs can be set using the below given properties.

MaskedEditBox Properties Description
OverflowIndicatorToolTipText Specifies the overflow indicator tooltip text.
ShowOverflowIndicator Gets or sets overflow indicator visibility.
ShowOverflowIndicatorToolTip Gets or sets can show overflow indicator tooltip.
this.maskedEditBox1.OverflowIndicatorToolTipText = "Text Overflow";
this.maskedEditBox1.ShowOverflowIndicator = true;
this.maskedEditBox1.ShowOverflowIndicatorToolTip = true;
Me.maskedEditBox1.OverflowIndicatorToolTipText = " Text Overflow"
Me.maskedEditBox1.ShowOverflowIndicator = True
Me.maskedEditBox1.ShowOverflowIndicatorToolTip = True

Set the tooltip of overflow indicator to WF MaskedEditBox control