Articles in this section
Category / Section

What is reason for the text value is different when the TextChanged event is handled and after the control lost the focus?

1 min read

Mask settings

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.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied