Jump to content

Problems with $button and $radio


 Share

Recommended Posts

GUICreate("Installer ver. " & $version, 375,500)

; Create the controls
$button_1 = GUICtrlCreateButton ("Install", 50, 450, 120, 40)
$group_1 = GUICtrlCreateGroup ("Profile:", 2, 50, 175, 200)
GUIStartGroup()
$radio_1 = GUICtrlCreateRadio ("Standard", 5, 70, 150, 20)
$radio_2 = GUICtrlCreateRadio ("Mobile", 5, 100, 150, 20)
$radio_3 = GUICtrlCreateRadio ("Advanced", 5, 130, 150, 20)
GUISetState ()


While 1
   $msg = GUIGetMsg()
   Select
         Case $msg = $GUI_EVENT_CLOSE
         Exit
        Case $msg = $button_1 AND $radio_1
         MsgBox(0, "Default button clicked", "Radio 1" )
      Case $msg = $button_1 AND $radio_2
         MsgBox(0, "Default button clicked", "Radio 2" )
        Case $msg = $button_1 AND $radio_3
         MsgBox(0, "Default button clicked", "Radio 3" )
   EndSelect
WEnd

Why this Case $msg = $button_1 AND $radio_3

always exectues msg from first case where radio_1 is. I have no clue how to make it ;( Help. I want the to choose radio button and then click Button to execute MSGBOX.

My little company: Evotec (PL version: Evotec)

Link to comment
Share on other sites

#include <GuiConstants.au3>
$version = "1.0"
GUICreate("Installer ver. " & $version, 375, 500)

; Create the controls
$button_1 = GUICtrlCreateButton("Install", 50, 450, 120, 40)
$group_1 = GUICtrlCreateGroup("Profile:", 2, 50, 175, 200)
GUIStartGroup()
$radio_1 = GUICtrlCreateRadio("Standard", 5, 70, 150, 20)
$radio_2 = GUICtrlCreateRadio("Mobile", 5, 100, 150, 20)
$radio_3 = GUICtrlCreateRadio("Advanced", 5, 130, 150, 20)
GUISetState()


While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $button_1 And BitAnd(GUICtrlRead($radio_1),$GUI_CHECKED) = $GUI_CHECKED
            MsgBox(0, "Default button clicked", "Radio 1")
        Case $msg = $button_1 And BitAnd(GUICtrlRead($radio_2),$GUI_CHECKED) = $GUI_CHECKED
            MsgBox(0, "Default button clicked", "Radio 2")
        Case $msg = $button_1 And BitAnd(GUICtrlRead($radio_3),$GUI_CHECKED) = $GUI_CHECKED
            MsgBox(0, "Default button clicked", "Radio 3")
    EndSelect
WEnd

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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...