Jump to content

Gui with Radio


Recommended Posts

#include<GuiButton.au3>

#include<GuiConstants.au3>

GUICreate("Select Option",300,150,500,300)

GuictrlCreateGroup("Select", 8, 18,140, 70)

$radio = GUICtrlCreateRadio("Automatic",40,30,90,26)

$radio = GUICtrlCreateRadio("Manual",40,60,90,26)

$button1 = GUICtrlCreateButton("OK",45,95,80,30)

GUISetState(@SW_SHOW)

Global $selected;

While 1

$msg = GUIGetMsg()

Select; selects which case in going on

Case $msg = $GUI_EVENT_CLOSE; if X is pressed it will close the window

MsgBox(4096,"Exit","You choose to exit")

ExitLoop

Case $msg = $button1; if button 1 is pressed then this action will follow

$RadioNumber = GuiCtrlRead($radio)

Select

case $radionumber = 0

$selected = "Automatic" ;it is not reaching here

case $radionumber = 1

$selected = "Manual" ; but it is reaching here

EndSelect

msgbox(0, "Selected", "Your Selection is:" & $selected);

EndSelect

WEnd

the control is reaching in the second radio but not the first one

whats the error in the code?please help.

thanks.

Link to comment
Share on other sites

Change

$radio = GUICtrlCreateRadio("Automatic",40,30,90,26)
$radio = GUICtrlCreateRadio("Manual",40,60,90,26)

to

$radio = GUICtrlCreateRadio("Automatic",40,30,90,26)
MsgBox (0, "Value of Radio", $radio)
$radio = GUICtrlCreateRadio("Manual",40,60,90,26)
MsgBox (0, "Value of Radio", $radio)

What do you observe?

Link to comment
Share on other sites

so wat can be done ?

to fish you must learn (yodas voice)

This is a way to debug your script, and since BrettF chose this area perhaps...

also you may want to look at the example under GUICtrlCreateRadio and see how this code differs from yours...

good luck

Link to comment
Share on other sites

to fish you must learn (yodas voice)

Got a kick out of that:

For a fish to have, to fish you must learn.

All I need is a picture of Yoda on a swampy Dagobah bank, with a rod cane pole and a bobber in the water.

:idea:

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...