I loop through buttons on a form using Press Tab.
How can I get a current button caption?
How can I get a current button/object caption?
Moderators: Dorian (MJT support), JRL
First you need to open the screen manually, then open ViewSystemWindows in MacroScheduler. This app shows everything running on your system (basically). Look for the Window Title with which you are working, then look for the items directly beneath the window title. You should see Button, ComboBox, etc...The captions will be listed next to them.
Now for an example. If I want to read (or change) the caption of the 3rd button in the list, it might look like this.
GetControlText>TheWindowTitle,Button,3,MyCaption3
or
SetControlText>TheWindowTitle,Button,3,My 3rd Button
You can use SetControlText to differentiate between identically named buttons within a session. Some programmers are sloppy enough to put multiple OK's or ADD etc....within a single screen. By renaming them you can easily use PushButton> and it will apply to the unique name you apply instead of getting confused about which "OK" you would like to push.
Is this clear as mud?
I use these quite extensively. Please ask again if I need to send some sample code or better explain View System windows.
Skunkworks
Now for an example. If I want to read (or change) the caption of the 3rd button in the list, it might look like this.
GetControlText>TheWindowTitle,Button,3,MyCaption3
or
SetControlText>TheWindowTitle,Button,3,My 3rd Button
You can use SetControlText to differentiate between identically named buttons within a session. Some programmers are sloppy enough to put multiple OK's or ADD etc....within a single screen. By renaming them you can easily use PushButton> and it will apply to the unique name you apply instead of getting confused about which "OK" you would like to push.
Is this clear as mud?
I use these quite extensively. Please ask again if I need to send some sample code or better explain View System windows.
Skunkworks
-
- Newbie
- Posts: 7
- Joined: Wed Jun 07, 2006 1:41 pm
- Location: india
- Contact:
Doubt
Hi there,
I tried the steps you mentioned. I want to update a textbox of the windows application developed using .NET.
In "View Systems Windows" I got textbox description as "3934552 - WindowsForms10.EDIT.app3 "Build 229""
I want to replace text box text "Build 229" with something using SetControlText command. Window title is "Build All"
Can you help me forming the command for the same?
thanks in advance.
Paresh
I tried the steps you mentioned. I want to update a textbox of the windows application developed using .NET.
In "View Systems Windows" I got textbox description as "3934552 - WindowsForms10.EDIT.app3 "Build 229""
I want to replace text box text "Build 229" with something using SetControlText command. Window title is "Build All"
Can you help me forming the command for the same?
thanks in advance.
Paresh
the rare 1
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Based on the information you have extracted from View System Windows you should use:
SetWindowText>Build All,WindowsForms10.EDIT.app3,1,NewText
This sets the FIRST instance of a WindowsForms10.EDIT.app3 object. If there is more than one of these classes on the window then you'd need to change the instance number (third parameter).
So if you see more than one instance of WindowsForms10.EDIT.app3 in the tree beneath the "Build All" window in View System Windows you need to determine the instance number. Sometimes the instances are created in reverse so you may need to count UP rather than down. Either way a bit of trial and error is often needed here.
SetWindowText>Build All,WindowsForms10.EDIT.app3,1,NewText
This sets the FIRST instance of a WindowsForms10.EDIT.app3 object. If there is more than one of these classes on the window then you'd need to change the instance number (third parameter).
So if you see more than one instance of WindowsForms10.EDIT.app3 in the tree beneath the "Build All" window in View System Windows you need to determine the instance number. Sometimes the instances are created in reverse so you may need to count UP rather than down. Either way a bit of trial and error is often needed here.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?