Jump to content

Radio Button checking


Recommended Posts

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^^

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

:)

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...