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

Posted on 2006-03-31
Medium Priority
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.
Question by:fruhj
LVL 52

Accepted Solution

Carl Tawn earned 2000 total points
ID: 16346105
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.
LVL 12

Author Comment

ID: 16540553
Sorry about missing this,

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

Carl thanks for replying!

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Loops Section Overview
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question