World Cup Baby Posted May 25, 2006 Posted May 25, 2006 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!
World Cup Baby Posted May 25, 2006 Author Posted May 25, 2006 Oh, thought I might add that I'm using a series of ControlCommand with TabRight and TabLeft operations to "select" the desired tab...
World Cup Baby Posted May 29, 2006 Author Posted May 29, 2006 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 )
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now