Sign in to follow this  
Followers 0
Fossil Rock

I don't know how to explain it .... but if you can help....

2 posts in this topic

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!

My-Colors.jpg

cuniform2.gif

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by SmOke_N

[center]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.[/center]

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