Jump to content

Reacting to Checkboxes


Edifice
 Share

Recommended Posts

Func generatecolor()
    $color = "None"
    If GUICtrlread($check_color_black) = 1 Then
        $color = $color + "Black, "
    EndIf
    If GUICtrlread($check_color_blue) = 1 Then
        $color = $color + "Blue, "
    EndIf
    IF GUICtrlread($check_color_green) = 1 Then
        $color = $color + "Green, "
    EndIf
    If GUICtrlread($check_color_red) = 1 Then
        $color = $color + "Red, "
    EndIf
    IF GUICtrlread($check_color_silver) = 1 Then
        $color = $color + "Silver, "
    EndIf
    If GUICtrlread($check_color_yellow) = 1 Then
        $color = $color + "Yellow, "
    EndIf
    MsgBox(0, "Colors", $color)
EndFunc

All these $check_color_ - thingies are checkboxes.

Whenever I check one or more of the checkboxes off, All I get in my msgbox is a 0. If I don't check them off I get the declared value of the $color

I'm just wondering why, and was hoping one of you could explain that to me :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...