Limit Textbox inputs to Format
From: Brian Stigler (bkstigler_at_usa.net)
Date: 02/18/04
- Next message: Jeff Johnson [MVP:VB]: "Re: windows user name"
- Previous message: Bill Smith: "Accessing Active Directory"
- Next in thread: Rick Rothstein: "Re: Limit Textbox inputs to Format"
- Reply: Rick Rothstein: "Re: Limit Textbox inputs to Format"
- Reply: Randy Birch: "Re: Limit Textbox inputs to Format"
- Reply: Larry Serflaten: "Re: Limit Textbox inputs to Format"
- Reply: Brian Stigler: "Re: Limit Textbox inputs to Format"
- Reply: Randy Birch: "Re: Limit Textbox inputs to Format"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 17 Feb 2004 18:20:53 -0800
Here's an interesting one... I haven't had any luck coming up with a slick
solution...
I have a set of textboxes on a form. Each of the textboxes has an
associated format string for numeric input.
txtFormat(0)="0.00"
txtFormat(1)="0.0"
txtFormat(2)="0.000"
etc.
The associated formats can be different from run to run so I can't hard code
a format to a particular textbox... I just read the format string from an
XML input file.
Here's my question:
I would like to limit the user to numeric inputs only.... (no characters)
and also limit them to numbers in the format specified for each textbox.
So for example... if a user inputs 2a, the system would beep and the textbox
background would maybe flash red for a brief second indicating that the
input is invalid. Also, the character "a" would not be displayed since it
is an invalid character. (This eliminates the option of using the LostFocus
event since I would like an immediate response to the user.)
For valid numeric inputs... the user could input 1.23 and no more for a
textbox with a format of "0.00". Trying to type "1.234" would again yield a
beep and a red flash and the "4" would not be displayed since it exceeds the
format limit.
Any suggestions???
Thanks a bunch as always.
Brian
- Next message: Jeff Johnson [MVP:VB]: "Re: windows user name"
- Previous message: Bill Smith: "Accessing Active Directory"
- Next in thread: Rick Rothstein: "Re: Limit Textbox inputs to Format"
- Reply: Rick Rothstein: "Re: Limit Textbox inputs to Format"
- Reply: Randy Birch: "Re: Limit Textbox inputs to Format"
- Reply: Larry Serflaten: "Re: Limit Textbox inputs to Format"
- Reply: Brian Stigler: "Re: Limit Textbox inputs to Format"
- Reply: Randy Birch: "Re: Limit Textbox inputs to Format"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|