Do not use the Text property in the OnTextChanging event, as the value of the property is not guaranteed. The string being entered is passed to the OnTextChanging event as the text argument. You can check the text in OnTextChanging, and if necessary, change the text by overwriting it.