Solved

Vb.Net Form Reload following Click Event

Posted on 2003-11-04
2
526 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
Comment Utility
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
Comment Utility
Thanks for the help brother7!!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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…
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…

763 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

9 Experts available now in Live!

Get 1:1 Help Now