Jump to content

Recommended Posts

Posted

Good evening everyone,

I'm making a script that I need to send a message immediately when I click on a Radio button.

Example:

If Radio 01 a Message
If Radio 02 another Message

But without having to have another command after the selected Radio. It's possible?

 

I try this, 

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 437, 192, 124)
$Group1 = GUICtrlCreateGroup("Test list", 136, 88, 345, 97)
$Radio1 = GUICtrlCreateRadio("Message 01", 160, 112, 233, 17)
$Radio2 = GUICtrlCreateRadio("Message 02", 160, 144, 273, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlSetState(-1, $GUI_CHECKED)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        If GUICtrlRead($Radio1) = 1 Then

            MsgBox(0,0,"Radio 01",0)

        EndIf


        If GUICtrlRead($Radio2) = 1 Then

            MsgBox(0,0,"Radio 02",0)

        EndIf

    EndSwitch
WEnd

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
×
×
  • Create New...