Fossil Rock Posted October 19, 2006 Share Posted October 19, 2006 I'm getting odd results with line 28 (msgbox near the bottom)... it's giving a number instead of the text value. Can anyone point out what I'm doing wrong ? It's not complete, just a proof of concept idea. #include <GUIConstants.au3> $pos = 10 $title = "Choice " $Choices = 5 Dim $Radio[31] Opt("WinTitleMatchMode", 2) $GUI = GUICreate(" Radio Button Selector", 200, ($Choices * 20) + 65, -1, 100, "", $WS_EX_TOOLWINDOW) GUICtrlCreateLabel("Select a Radio Button", 10, 10) MakeChoices() GUISetState(@SW_SHOW) List1() Func List1() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Done() EndSelect Wend EndFunc Func MakeChoices() GUICtrlCreateGroup("", -99, -99, 1, 1) For $Counter = 1 To $Choices $Radio[$Counter] = GUICtrlCreateRadio($title & $Counter & " ", $pos, ($Counter * 20) + 10) MsgBox(0,"",$Counter & " / " & $Radio[$Counter]) Next EndFunc Func Done() MsgBox(0,"", "We're out of here.") Exit EndFunc Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 19, 2006 Moderators Share Posted October 19, 2006 (edited) It's giving you the Control ID of $Radio. GUICtrlRead($Radio[$Counter]), but even with that, I don't know what text you expect to get with using a Radio. It's only going to return the state (1 or 4). Edit: I should state 1 = checked (same as $GUI_CHECKED) and 4 = unchecked (same as $GUI_UNCHECKED). Edited October 19, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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