|
-
Jun 7th, 2000, 10:21 AM
#1
Thread Starter
Junior Member
E.g i type a question and put in 4 check boxes and a button.
How do i write the commandline in such a way that on when one of the check boxes is click on and the button is click on, the result will be made known to the user.
Thank you for your help.
-
Jun 7th, 2000, 12:08 PM
#2
Hmmm.....ok this is like a question with mutli answers yeah
Ok the question is in a textbox, and you clever thing, you are using it to handle multi questions????
Ok make sure the check Boxes are in an array, look at the index property to achieve this
So we have something like
txtQuestion.Text = "Who makes vb"
And four check boxes with
chkBox(0).Caption = "Netscape"
chkBox(1).Caption = "Borland"
chkBox(2).Caption = "General Automation"
chkBox(3).Caption = "Microsoft"
Ok add a label to the form and call it lblAnswer. Set the Caption to ""
Double click on your command button to bring up the code window, and enter
Public Sub cmdButton() ' ok vb already adds this
'
If chkBox(3).Value = vbChecked Then
lblAnswer.Caption = "Correct"
Else
lblAnswer.Caption = "Incorrect. The Answer is Microsoft"
End If
'
End Sub
Now l persume the check boxes are mutually exlusive, if not provide more detailed instructions in your label
Hope it helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|