Medic873 Posted March 9, 2010 Share Posted March 9, 2010 This should be simple but i cant quite get it to work I have 4 gui buttons and im trying to make it idetifie witch one is clicked and if one is checked and then they click the start button start fallowing more of my script so this is my current code Case $msg = $Select2 And BitAND(GUICtrlRead($SelectYoutube), $GUI_CHECKED) = $GUI_CHECKED Case $btn_start MsgBox(4096, "22", "2 was selected", 10) please help i dont know what im doing wrong. Link to comment Share on other sites More sharing options...
Fire Posted March 9, 2010 Share Posted March 9, 2010 This is my sample is it what you are looking for? #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("Form1", 317, 144, 192, 124) $Button1 = GUICtrlCreateButton("Button1", 72, 104, 145, 25, $WS_GROUP) GUICtrlSetState($Button1,$GUI_DISABLE) $Radio1 = GUICtrlCreateRadio("Radio1", 168, 24, 113, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Radio1 If BitAND(GUICtrlRead($Radio1), $GUI_CHECKED) Then GUICtrlSetState($Button1,$gui_enable) else GUICtrlSetState($Button1,$GUI_DISABLE) EndIf Case $Button1 MsgBox(0,"Clicked!","I`m Working Now...",3) GUICtrlSetState($Radio1,$gui_UNCHECKED) GUICtrlSetState($Button1,$GUI_DISABLE) EndSwitch WEnd [size="5"] [/size] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 9, 2010 Moderators Share Posted March 9, 2010 Medic873, Perhaps this might help: expandcollapse popup#include <GUIConstantsEx.au3> #include <ButtonConstants.au3> $hGUI = GUICreate("Test", 500, 500) GUIStartGroup() $hRadio_1 = GUICtrlCreateRadio(" Radio 1", 10, 10, 100, 20) $hRadio_2 = GUICtrlCreateRadio(" Radio 2", 10, 30, 100, 20) $hRadio_3 = GUICtrlCreateRadio(" Radio 3", 10, 50, 100, 20) $hRadio_4 = GUICtrlCreateRadio(" Radio 4", 10, 70, 100, 20) $hButton_Start_1 = GUICtrlCreateButton("Start 1", 10, 100, 80, 30) $hBut_1 = GUICtrlCreateCheckbox("Button 1", 400, 10, 50, 20, $BS_PUSHLIKE) $hBut_2 = GUICtrlCreateCheckbox("Button 2", 400, 30, 50, 20, $BS_PUSHLIKE) $hBut_3 = GUICtrlCreateCheckbox("Button 3", 400, 50, 50, 20, $BS_PUSHLIKE) $hBut_4 = GUICtrlCreateCheckbox("Button 4", 400, 70, 50, 20, $BS_PUSHLIKE) $hButton_Start_2 = GUICtrlCreateButton("Start 1", 400, 100, 80, 30) GUISetState() While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit ; This is for the radios on the left Case $hButton_Start_1 For $i = $hRadio_1 To $hRadio_4 If GUICtrlRead($i) = 1 Then MsgBox(0, "", "Radio " & $i - $hRadio_1 + 1 & " checked") ExitLoop EndIf Next ; This is for the buttons on the right Case $hButton_Start_2 For $i = $hBut_1 To $hBut_4 If GUICtrlRead($i) = 1 Then MsgBox(0, "", "Button " & $i - $hBut_1 + 1 & " checked") ExitLoop EndIf Next Case $hBut_1 To $hBut_4 For $i = $hBut_1 To $hBut_4 GUICtrlSetState($i, $GUI_UNCHECKED) Next GUICtrlSetState($iMsg, $GUI_CHECKED) EndSwitch WEnd M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now