Log in

View Full Version : Visual Basic Help


lamlamlamiaaa
Nov 30, 2010, 06:20 PM
Okai I need help in my visual basic assignment. So,
There are 5 checkboxes and what I want is that, when I click on a checkbox I want it to be listed automatically in a label or something, in any order. Get it?? PLEASE HELP Thank you!

GaryStaunton
Nov 30, 2010, 10:52 PM
Look up how to use the Checkbox in the help file. You can use the Click event, for example:

Private Sub Check1_Click()

Dim TextToDisplay As String

If Check1.Value = 1 Then TextToDisplay = "Check 1" Else TextToDisplay = ""

Label1.Caption = TextToDisplay

End Sub

Hope that guides you.

GaryStaunton
Nov 30, 2010, 10:54 PM
Look up how to use the Checkbox in the help file. You can use the Click event, for example:

Private Sub Check1_Click()

Dim TextToDisplay As String

If Check1.Value = 1 Then TextToDisplay = "Check 1" Else TextToDisplay = ""

Label1.Caption = TextToDisplay

End Sub

Hope that guides you.

lamlamlamiaaa
Dec 1, 2010, 02:24 PM
It doesn't work.
What I want it to do is that, when a checkbox1,2,3,4... is checked then I want labels to show what I have checked it, in the order that I checked it.
Please suggest a different one.

GaryStaunton
Dec 8, 2010, 10:29 PM
Would be nice to see an example of the output.

Try this:

Label1.Caption = Label1.Caption & TextToDisplay & " "