SkiFreak Posted September 15, 2006 Share Posted September 15, 2006 Back again with another dilema. Unlike my previous syntax positioning boo boo, this one I cannot work out. What I want to do is, in my mind, a simple task. Making it happen with AutoIt is proving to be a challenge however. What I am after is some "clean code" that will detect when a radio button is selected and clear the checked state of other radio buttons in a different group. Both groups are on the same page of a tabbed form. I have code that will clear all radio buttons when I switch from tab to tab (a requirement) but this has not been included in the sample below. It is not a mistake that all radio buttons on Tab1 belong to the same array. This makes it easier for me to do some other tasks. expandcollapse popup#include <GUIConstants.au3> #include <GuiTab.au3> Global $arrOne[20] Global $arrTwo[5] GUICreate("Multi tabbed form with radio buttons",800,400) $fault="" $tab=GUICtrlCreateTab (0,0,800,340) $tab0=GUICtrlCreateTabitem ("Tab1") GUISetFont (10, 400) GUICtrlCreateGroup("Group1",60,40,290,140) GUIStartGroup() $arrOne[0] = GUICtrlCreateRadio (" text ", 130, 70, 190, 15) $arrOne[1] = GUICtrlCreateRadio (" text ", 130, 90, 190, 15) $arrOne[2] = GUICtrlCreateRadio (" text ", 130, 110, 190, 15) $arrOne[3] = GUICtrlCreateRadio (" text ", 130, 130, 190, 15) GUICtrlCreateGroup("Group2",360,40,290,140) $arrOne[10] = GUICtrlCreateRadio (" text ", 430, 70, 190, 15) $arrOne[11] = GUICtrlCreateRadio (" text ", 430, 90, 190, 15) $arrOne[12] = GUICtrlCreateRadio (" text ", 430, 110, 190, 15) $arrOne[13] = GUICtrlCreateRadio (" text ", 430, 130, 190, 15) $Tab1=GUICtrlCreateTabitem ("Tab2") GUISetFont (10, 400) GUICtrlCreateGroup("Group3",60,40,290,140) $arrTwo[0] = GUICtrlCreateRadio (" text ", 130, 70, 190, 15) $arrTwo[1] = GUICtrlCreateRadio (" text ", 130, 90, 190, 15) $arrTwo[2] = GUICtrlCreateRadio (" text ", 130, 110, 190, 15) $arrTwo[3] = GUICtrlCreateRadio (" text ", 130, 130, 190, 15) $arrTwo[4] = GUICtrlCreateRadio (" text ", 130, 150, 190, 15) GUICtrlCreateTabitem ("") $buttonsubmit=GUICtrlCreateButton ("Submit", 225,350,150,30) $buttonCancel=GUICtrlCreateButton ("Cancel", 425,350,150,30) _GUICtrlTabSetMinTabWidth ($tab, 125) GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $buttonCancel ExitLoop Case $msg = $buttonsubmit EndSelect Wend I need some help here. Anyone got a solution to this? Link to comment Share on other sites More sharing options...
MHz Posted September 15, 2006 Share Posted September 15, 2006 Like a radio button click in group 1 will clear all radio buttons in group 2? expandcollapse popup#include <GUIConstants.au3> #include <GuiTab.au3> Global $arrOne[20] Global $arrTwo[5] GUICreate("Multi tabbed form with radio buttons",800,400) $fault="" $tab=GUICtrlCreateTab (0,0,800,340) $tab0=GUICtrlCreateTabitem ("Tab1") GUISetFont (10, 400) GUICtrlCreateGroup("Group1",60,40,290,140) GUIStartGroup() $arrOne[0] = GUICtrlCreateRadio (" text ", 130, 70, 190, 15) $arrOne[1] = GUICtrlCreateRadio (" text ", 130, 90, 190, 15) $arrOne[2] = GUICtrlCreateRadio (" text ", 130, 110, 190, 15) $arrOne[3] = GUICtrlCreateRadio (" text ", 130, 130, 190, 15) GUICtrlCreateGroup("Group2",360,40,290,140) $arrOne[10] = GUICtrlCreateRadio (" text ", 430, 70, 190, 15) $arrOne[11] = GUICtrlCreateRadio (" text ", 430, 90, 190, 15) $arrOne[12] = GUICtrlCreateRadio (" text ", 430, 110, 190, 15) $arrOne[13] = GUICtrlCreateRadio (" text ", 430, 130, 190, 15) $Tab1=GUICtrlCreateTabitem ("Tab2") GUISetFont (10, 400) GUICtrlCreateGroup("Group3",60,40,290,140) $arrTwo[0] = GUICtrlCreateRadio (" text ", 130, 70, 190, 15) $arrTwo[1] = GUICtrlCreateRadio (" text ", 130, 90, 190, 15) $arrTwo[2] = GUICtrlCreateRadio (" text ", 130, 110, 190, 15) $arrTwo[3] = GUICtrlCreateRadio (" text ", 130, 130, 190, 15) $arrTwo[4] = GUICtrlCreateRadio (" text ", 130, 150, 190, 15) GUICtrlCreateTabitem ("") $buttonsubmit=GUICtrlCreateButton ("Submit", 225,350,150,30) $buttonCancel=GUICtrlCreateButton ("Cancel", 425,350,150,30) _GUICtrlTabSetMinTabWidth ($tab, 125) GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $buttonCancel ExitLoop Case $msg = $buttonsubmit Case $msg >= $arrOne[0] And $msg <= $arrOne[3]; On click radio buttons in group 1 ; Uncheck radio buttons in group 2 For $i = 10 To 13 GUICtrlSetState($arrOne[$i], $GUI_UNCHECKED) Next EndSelect Wend Look at the change in the loop. Link to comment Share on other sites More sharing options...
SkiFreak Posted September 17, 2006 Author Share Posted September 17, 2006 Thanks. This is exactly what I was looking for. 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