Jump to content
Sign in to follow this  
Ryukk0

checkbox radio need help plz

Recommended Posts

Ryukk0

i need help in checkbox's and radios... i put an example in the end i have that GUI with 2 Radios each 1 do a diferent thing 1spams a "I" the other a "W". but i can only make them send 1 of each how do i make them send untin radio isnt checked???? PS: sorry for bad english TY in advance..

#include <ButtonConstants.au3>

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 164, 34, 192, 124)

$Radio1 = GUICtrlCreateRadio("SpamI", 8, 8, 49, 17)

$Radio2 = GUICtrlCreateRadio("SpamX", 96, 8, 57, 17)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Radio1

send("i")

Case $Radio2

Send("x")

EndSwitch

WEnd

Share this post


Link to post
Share on other sites
sleepydvdr

Is this what you want? I added in a button to uncheck the radios.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiButton.au3>
 
$message = 0
 
$Form1 = GUICreate("Form1", 164, 34, 192, 124)
$Radio1 = GUICtrlCreateRadio("SpamI", 8, 8, 49, 17)
$Radio2 = GUICtrlCreateRadio("SpamX", 96, 8, 57, 17)
$Button1 = GUICtrlCreateButton("", 62, 8, 27, 17)
GUISetState(@SW_SHOW)
 
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Radio1
            _i()
        Case $Radio2
            _x()
        Case $Button1
            $test = GUICtrlRead($Button1)
            GUICtrlSetState($Radio1, $GUI_UNCHECKED)
            GUICtrlSetState($Radio2, $GUI_UNCHECKED)
    EndSwitch
WEnd
 
Func _i()
    Do
        Send("i")
        Sleep(100)
    Until GUICtrlRead($Radio1) = 4 OR _GUICtrlButton_GetState($Button1) = $BST_FOCUS
EndFunc   ;==>_i
 
Func _x()
    Do
        Send("x")
        Sleep(100)
    Until GUICtrlRead($Radio2) = 4 OR _GUICtrlButton_GetState($Button1) = $BST_FOCUS
EndFunc   ;==>_x

#include <ByteMe.au3>

Share this post


Link to post
Share on other sites
Ryukk0

ya its that... tnkz alot...

can i make a func for pixelsearch too???

Edited by Ryukk0

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  

×