Re: Prompt characters in a MaskedTextBox

John Warner <[email protected]> Thu, 7 Feb 2008 11:44:27 -0500
Newsgroups gmane.comp.windows.devel.dotnet.winforms
Organization John Warner
Message-ID <002f01c869a8$b4713780$3d02a8c0@Pluto>
One option that I suspect you considered and rejected is just use a =
regular
textbox, do not give the user a 'mask' but instead place a label control
where it makes best sense on your form with an example of the input =
pattern
you expect. Naturally 99 out of 100 users will screw this up, I would =
trap
a key event for the textbox and compare it with what I want as user goes
along. Are we trying to block 'illegal' characters here or are we after =
a
very specific pattern? Another option would be several boxes and collect
the desired information and format it with code in your program. Again =
I'm
sure you have already considered and rejected these, but seemed like
something to toss out anyway.

John Warner




> -----Original Message-----
> From: Discussion forum for developers using Windows Forms to=20
> build apps and controls=20
> [mailto:[email protected]] On Behalf Of=20
> Bhatnagar, Amit
> Sent: Wednesday, February 06, 2008 10:57 AM
> To: [email protected]
> Subject: [DOTNET-WINFORMS] Prompt characters in a MaskedTextBox
>=20
>=20
> I have the need to create a customized text entry box that=20
> can accept various types of geographic coordinates. The problem=20
>=20
> The MaskedTextBox only allows a single prompt character to be=20
> displayed upon user input. I need the ability to display=20
> different prompt characters for certain character positions.=20
> How can I do this? Also, due to the nature of the text being=20
> inputted, I suspect that I will need to use a regex to=20
> validate this properly. So I'm assuming because of these two=20
> limitations, that the MaskedTextBox isn't the way to go.
>=20
> Does anyone have any suggestions on how I can go about this?=20
> Use a regular text box and validate against a reg expression?=20
> But how do I handle displaying the custom prompt characters?
>=20
> The information contained in this e-mail message is PRIVATE.=20
> It may contain confidential information and may be legally=20
> privileged. It is intended for the exclusive use of the=20
> addressee(s). If you are not the intended recipient, you are=20
> hereby notified that any dissemination, distribution or=20
> reproduction of this communication is strictly prohibited. If=20
> the intended recipient(s) cannot be reached or if a=20
> transmission problem has occurred, please notify the sender=20
> immediately by return e-mail and destroy all copies of this message.=20
> Thank you.=20
>=20