Jump to content
Sign in to follow this  
Vision

Radio Button checking

Recommended Posts

Vision

HI,

i need some help^^

i will perform a permanent check if $radiobutton1 or $radiobutton2 is checked,

if radio button 1 is checked go the Func1 etc...

i have actually this here, but it dont work...

While
    $msg = GUIGetMsg()
    
        Select
        Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
        Case $msg = $Radio1
                _radiobtnchecked1()
        Case $msg = $Radio2
                _radiobtnchecked2()
        EndSelect

Wend

        
Func _radiobtnchecked1()
        $msg = GUIGetMsg()
    While 1
        Select
        Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
        Case $msg = $Button1
                _GetData1()
        Case $msg = $Button2
                _GetData2()
        Case $msg = $Button3
                _GetData3()
        EndSelect
    WEnd
        
Endfunc

Func _radiobtnchecked2()
        $msg = GUIGetMsg()
    While 1
        Select
        Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
        Case $msg = $Button1
                _MsgOut("p1")
        Case $msg = $Button2
                _MsgOut("p2")
        Case $msg = $Button3
                _MsgOut("p3")
        EndSelect
    Wend
EndFunc

can someone help me :/?

if there any question pls ask me^^

Share this post


Link to post
Share on other sites
rasim

Look to AdlibEnable() in help file.

Share this post


Link to post
Share on other sites
Vision

i cant get them work...

i need something like this:

if checkbox is unckecked do this1

if checkbox is checked do this2

and with AdlibEnable() i can check every 1 second if the checkbox is checked or unchecked

exsamle:

so if the checkbox is unchecked i will when i push the button1 that they do the func test1

and if the checkbox is checked and i push the button1 that they do the func test2

would be very nice

Edited by Vision

Share this post


Link to post
Share on other sites
rasim

Hi! This is not a hard:

#include <GuiConstants.au3>

$hGUI = GUICreate("Test GUI", 200, 100)

$Checkbox = GUICtrlCreateCheckbox("Checkbox", 50, 20, 70, 16)

$button = GUICtrlCreateButton("Button", 50, 70, 60, 25)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $button
            If GUICtrlRead($Checkbox) = $GUI_UNCHECKED Then
                _Test1()
            Else
                _Test2()
            EndIf
    EndSwitch
WEnd

Func _Test1()
    ConsoleWrite("_Test1" & @LF)
EndFunc

Func _Test2()
    ConsoleWrite("_Test2" & @LF)
EndFunc

:)

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  

×