Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 539
  • Last Modified:

Vb.Net Form Reload following Click Event

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
bfrancisco
Asked:
bfrancisco
1 Solution
 
brother7Commented:
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
 
bfranciscoAuthor Commented:
Thanks for the help brother7!!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now