Solved

Vb.Net Form Reload following Click Event

Posted on 2003-11-04
2
532 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

751 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