Solved

Vb.Net Form Reload following Click Event

Posted on 2003-11-04
2
529 Views
Last Modified: 2008-02-01
How can I reload a VB.Net form following a click event?  The click event is a "Clear" event, using the NullChar value to clear text, etc., from all input text boxes.  During data input my program validates the input to make sure it's either text or a numeric value.  Right now, if I insert the a text value in a text box that is only to get numeric input an error message pops up (which is what I want it to do).  However, to erase my errant input, if I click the "Clear" button the input is cleared but using the same instance of the form will precludes my input validation from working. In other words, if I use the clear button to clear bad input data and I retype bad data back in, my data validation doesn't work.  If the form is reinitialized or reloaded, the validation works.  So, inorder to be able to validate input I need to reload the form with my "Clear" event handler.  How can this be done and what is the best way to do it?
0
Comment
Question by:bfrancisco
2 Comments
 
LVL 4

Accepted Solution

by:
brother7 earned 250 total points
ID: 9682421
Scenario: You have 5 textboxes. The first 4 contain valid numeric inputs. "hello" is entered into the 5th textbox.  This is invalid input.  In your proposed action, all textboxes would be cleared, and the user starts all over from textbox 1.  Is this the desired behavior?

IMO, it's preferable to keep the valid input that's already been entered, and prompt the user to re-enter the data for the current textbox.  To do this, you should validate each textbox entry individually.   For each textbox, create 2 events... a Validating event and a Validated event.
0
 

Author Comment

by:bfrancisco
ID: 9682506
Thanks for the help brother7!!
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

810 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