The basic concept is that you have a VB
form to input two distiguishable words into a single text box. The two words have a length specification were the first word
must be 5 characters long and the second must be 6 characters long. A single character seperates the two words. No
specification is made on what the seperating character must be so you should accept anything. The program should read in
the two words from the text box and insure that the words meet the specification.
Create a form class using your knowledge of VB.
The code should use only IF /ELSE and class logic to accomplish the task.
Form Properties and Contents
At the top of the form there should be text explaining to the user what actions are required in the form.
Enter Two Words
First Word is Five Character
Second Word is Six Characters
For the two words there is a seperating character of some type, but since most users understand that two words are
individual entitites this instruction is NOT required in the form. However, you cord should handle and type of seperating
A text box is require to accept the two words or anything else the use may type
Two buttons are to be placed on the form.
1) Button 1 Named "Submit"
The action for the first button is to Submit the contents of the text box and do the appropriate tasks required for the data
Validate that contents of the box are either new or the contents reset. (reset explained in button 2)
Validate the total string entered and the individual strings entered match the requirements
If the either requirement fails spawn a message box stating the following
Error!!! Error!!! Error!!!
String Length is: <Total String Length>
String Contains: <Input String Value>
Press reset button and try again :
Additionally, If the user hits the Submit button after and error has occurred WITHOUT hitting the Reset button the program
must populate a label underneath the text box stating "You did not reset"
The text for this label should be RED and the Background of the label in BLUE
*** The label used for this text should be empty for ever condition except when prompting for failure to reset
2) Button 2 Named “Reset”
The action for the second button is to Reset the contents of the text box with the following text Exactly as typed:
The Reset Button should also clear the label used to display "You did not reset" from the form.
Edited 7 Years Ago by mrmodest: n/a