Sign in to follow this  
Followers 0
World Cup Baby

Controlling a particular button on a particular tab in a multi-tab window

3 posts in this topic

I'd like to automate clicking a particular button on a particular tab on a tabbed window using the ControlClick() function. The same button appears on all of the tabs on the target window.

My script "selects" the right tab, then does a ControlClick with either the Control ID or the ClassName NN value as the argument.

The result I'm getting is that if Control ID is passed, the button on the right-most tab is what appears to be activated. If ClassName NN is passed, the button on the left-most (first) tab is activated. This behavior is consistent, but either way it is not the result I'm seeking.

First off, what is the difference between these two? Why the different result?

Secondly, what is the proper technique for doing what I want to do?

Thanks very much for your time and help and have a great day!

Share this post


Link to post
Share on other sites



Oh, thought I might add that I'm using a series of ControlCommand with TabRight and TabLeft operations to "select" the desired tab...

Share this post


Link to post
Share on other sites

Still can't figure out ControlClick behaviour, but the following alternative seems to work:

;... navigation to the correct tab complete
ControlShow( $Window_title, $window_text, $add_button )
ControlEnable( $Window_title, $window_text, $add_button )
ControlSend( $Window_title, $window_text, $add_button, "!a" )

To recap, I'm working with a multi-tabbed window, and each tab has a button (same name & control ID on each tab). Clicking on each tab brings up a different results window. The goal is to simulate click-on-correct-tab, then-click-on-the-button-on-tab sequence. My previous attempt did a ControlClick immediately after navigating to the correct tab, and that had the effect of either bringing up the result window associated with the left-most tab (i.e., $add_button set to control ID number of 11), or the result window of the right-most tab (i.e., $add_button set to ClassNameNN value of "Button31"). (Searching through other posts, it seemed as though that "Control ID" and "ClassNameNN" were interchangeable arguments to the ControlXXXX functions that expect control ID).

If someone can provide some explanation as to why the following doesn't produce the same result as the code above, I'd really appreciate it. Thanks!

;... navigation to the correct tab complete
ControlShow( $Window_title, $window_text, $add_button )
ControlEnable( $Window_title, $window_text, $add_button )
ControlClick( $Window_title, $window_text, $add_button )

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  
Followers 0