Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Visual Basic (https://www.askmehelpdesk.com/forumdisplay.php?f=469)
-   -   Visual Basic Help (https://www.askmehelpdesk.com/showthread.php?t=530488)

  • Nov 30, 2010, 06:20 PM
    lamlamlamiaaa
    Visual Basic Help
    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!
  • Nov 30, 2010, 10:52 PM
    GaryStaunton
    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.
  • Nov 30, 2010, 10:54 PM
    GaryStaunton
    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.
  • Dec 1, 2010, 02:24 PM
    lamlamlamiaaa
    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.
  • Dec 8, 2010, 10:29 PM
    GaryStaunton
    Would be nice to see an example of the output.

    Try this:

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

  • All times are GMT -7. The time now is 03:34 AM.