We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Why is the text value is different when the TextChanged event is handled and after the control has lost focus?

 

The reason for this difference is the existence of DataGroups for the MaskedEditBox with different DataGroupAlignments. The DataGroups alignments will only apply after the control has lost the focus. This results in the Text property returning a value based on the unaligned state of the control.

For example, if the Mask string is set to ##.### and the following properties are set: UsageMode: Numeric (this means that the decimal and number part of the mask will be split into 2 default groups) PaddingCharacter: 0 In this case, when the user types in the number 2 with the cursor at the beginning of the text and the TextChanged event is handled, the Text property will return the value: 20.000 However, when the control loses the focus and the group alignment is applied, the Text property returns the value 02.000 On account of these reasons, do not use the Text property value from within the TextChanged event if there are DataGroups defined and the PaddingCharacter property is set to a value that will influence the Text property (like in the above example).

Article ID: Published Date: Last Revised Date: Platform: Control:
1096 04/30/2011 07/10/2014 Windows Forms MaskedEditBox
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon