Jump to content
Sign in to follow this  
falco85

Implementation issues with check buttons

Recommended Posts

falco85

Hi guys,

I am trying to automate the check/uncheck of check boxes in a program, trying to use ControlCommand. However, it doesn't work when trying to uncheck something. A turnaround to this problem would be to send tabs and space but the problem is that I don't know the initial state of the box and I want to make sure that it will check/uncheck when I tell the script to do so. Therefore this is critical for my script. Any help on that issue is greatly appreciated :) Thank you

Share this post


Link to post
Share on other sites
PsaltyDS

Hi guys,

I am trying to automate the check/uncheck of check boxes in a program, trying to use ControlCommand. However, it doesn't work when trying to uncheck something. A turnaround to this problem would be to send tabs and space but the problem is that I don't know the initial state of the box and I want to make sure that it will check/uncheck when I tell the script to do so. Therefore this is critical for my script. Any help on that issue is greatly appreciated :) Thank you

Run the AutoIt Window Info Tool (AU3Info.exe) to identify the control, then post the control information and ControlCommand() code you tried on it.

:)


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

Share this post


Link to post
Share on other sites
komalo

also ,you can try ControlSend with Space on this control since ControlCommand don't work on it


[font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font]

Share this post


Link to post
Share on other sites
Ealric

I don't use ControlCommand personally but reading the documentation it appears you can still do something similar...

_check("NameOfYourControlID")

Func _check($controlID)
    If BitAND(ControlCommand("Title","",$controlID,"IsChecked",""),1) = 1 Then
        ;box state is checked so uncheck
        ControlCommand("Title","",$controlID,"UnCheck","")
    Else
        ;box is unchecked so check it
        ControlCommand("Title","",$controlID,"Check","")
    EndIf
EndFunc
Edited by Ealric

My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]

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  

×