Posted 15 years ago
by David Mullin
I've set the Mask property of a MaskedTextBox to be ".........", which works as expected. There is an odd visual behavior that I'd like to address (if possible). If the field is empty, and I click near the right side of the field, the caret is positioned at the end of the mask - making it look like there are 10 blank characters in the field. If I start typing, the caret then jumps to the beginning of the field, and everything behaves normally.
I tried to address this through the Mask, by providing a Mask of ".?.?.?.?.?.?.?.?.?.?" which, I thought, would say "ten optional characters". The end results, however, was a field that rejected all user input (not really what I expected, but I'm an extreme novice at RegEx).
I also tried the Mask of ".{1,10}", and this looked better (in that there only appeared to be 1 blank space at the beginning). Oddly, the Mask ".{0,10}" wouldn't let me type anything.
What am I missing?
David Mullin
[Modified at 06/11/2009 11:29 AM]
I tried to address this through the Mask, by providing a Mask of ".?.?.?.?.?.?.?.?.?.?" which, I thought, would say "ten optional characters". The end results, however, was a field that rejected all user input (not really what I expected, but I'm an extreme novice at RegEx).
I also tried the Mask of ".{1,10}", and this looked better (in that there only appeared to be 1 blank space at the beginning). Oddly, the Mask ".{0,10}" wouldn't let me type anything.
What am I missing?
David Mullin
[Modified at 06/11/2009 11:29 AM]