Solved

Vb.Net Form Reload following Click Event

Posted on 2003-11-04
2
528 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

911 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now