We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

VB.net 2.0 Winforms: textbox bound to an integer database field doesn't accept text, yet no user error thrown?

fruhj
fruhj asked
on
Medium Priority
390 Views
Last Modified: 2009-07-29
Textboxes bound to integers 'trap' the cursor if A-Z are entered....
I'd like to make this more user friendly!

----------------------------------------------------------------------

I'm building a simple data entry form in Vb.net 2.0

I have a bunch of bound textboxes.

to my delight, the textboxes bound to numeric fields in the database seem to have some nice functionality - although they'll take A-Z, you can't leave the field if those values are present.

There's no beep, no little red circle, nothing!

I assume this is a 'feature' in .net, I'd like to know how to 'enhance' the feature, by letting a user know WHY they are 'trapped' in the field.
Comment
Watch Question

Senior Systems and Integration Developer
CERTIFIED EXPERT
Commented:
Theres no little red circle because you presumably don't have a range validator control on your form linked to the textbox. Try adding one, you can specify that only numbers are allowed and define a message to be displayed if the input is invalid.

Alternatively you can manually validate the data using the KeyPress or Validating events for the control.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Sorry about missing this,

Started a new contract with no access to EE :-(

Carl thanks for replying!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.