Jump to content

TcxCheckBox set and get checked state


Recommended Posts

Hi

I am using AutoIt to test an application developed in Delphi using Developer Express VCL Components.

I need to check/uncheck a TcxCheckBox and read whether it is checked/unchecked.

The standard VCL TCheckBox can be set using:

ControlCommand($win, "", $ctrl, "Check") / ControlCommand($win, "", $ctrl, "UnCheck")

and read by

$res = ControlCommand($win, "", $ctrl, "isChecked")

But this does not work with TcxCheckBox.

I can toggle between checked/unchecked with

ControlSend($win, "", $ctrl, "{SPACE}")

but I have not found a way to read the checked state.

Do you have some suggestions / hints?

Thanks

Dennis Christensen

Link to comment
Share on other sites

Hi

<Use the WinActive() function to force the control's window to the top before using ControlCommand() on these controls

Thanks.

Unfortunately this is not enough.

I tried testing a bit more.

The AutoIt ControlCommand function sends BM_GETSTATE and BM_SETSTATE messages to the CheckBox, but the DevExpress TcxCheckBox does not seem to respond to them (the standard Delphi TCheckBox does).

Any ideas?

Best regards

Dennis

Link to comment
Share on other sites

ControlCommand is a good solution, but maybe Check CtrlId is wrong.

_GetCheckState ( 'Title', $_CtrlId )

Func _GetCheckState ( $_GuiTitle, $_Check )
    Return ControlCommand ( $_GuiTitle, "", $_Check, "IsChecked", "" )
EndFunc ;==> _GetCheckState ( )

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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