Pete (BSC)
Well-known member
- Joined
- Oct 19, 2007
- Messages
- 89
- Programming Experience
- 10+
I have a derived user control that inherits the MaskedTextBox... If I press the ESC key while the maskedtextbox has focus (in my code causes the .ClearValue method to be called) when I input space or a valid character, the entire mask is moved.
For example: if my mask is 00-LLL-000 with the prompt char = "#"
Before: [##-###-##]
After: [ ##-###-##] or it could be at a different position [##- ###-##]
Then, after the 2nd inputed character... it drops the original space or character and the mask is no longer moving.
If I press a button that calls .ClearValue, I don't have this problem.
I do have this code in place:
If e.KeyChar = ChrW(Keys.Escape) Then
e.Handled = True
End If
To prevent beeping.
For example: if my mask is 00-LLL-000 with the prompt char = "#"
Before: [##-###-##]
After: [ ##-###-##] or it could be at a different position [##- ###-##]
Then, after the 2nd inputed character... it drops the original space or character and the mask is no longer moving.
If I press a button that calls .ClearValue, I don't have this problem.
I do have this code in place:
If e.KeyChar = ChrW(Keys.Escape) Then
e.Handled = True
End If
To prevent beeping.
Last edited: