Jump to content

Not able to select a checkbox


Recommended Posts

I need to verify the status of a checkbox. If it had not been checked, I need to check it. I have written the below code:

if ControlCommand("", "", "[CLASS:WindowsForms10.window.b.app.0.3a9f0c_r16_ad1; INSTANCE:4]", "IsChecked", "") < 1 Then

ControlClick("", "", "[CLASS:WindowsForms10.window.b.app.0.3a9f0c_r16_ad1; INSTANCE:4]")

EndIf

While running the script, "if" condition passes. But the checkbox is not selected (checked). How to make it to work?

Link to post
Share on other sites

If your ControlCommand can detect the checkbox correctly, why not use ControlCommand to check the box?

If ControlCommand("", "", "[CLASS:WindowsForms10.Window.b.app.0.3a9f0c_r16_ad1; INSTANCE:4]", "IsChecked", "") < 1 Then
     ControlCommand("", "", "[CLASS:WindowsForms10.Window.b.app.0.3a9f0c_r16_ad1; INSTANCE:4]", "Check", "")
EndIf
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...