Sign in to follow this  
Followers 0
MadBoy

Problems with $button and $radio

3 posts in this topic

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)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Great. It works. Tnx.

Edited by MadBoy

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
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
Sign in to follow this  
Followers 0