I am trying to get the SetControlText to change the value of a combo box. As a test case, I am trying to change the Location combo box in the
Regional and Language Options. That window is already open.
When I run this:
---
let>npEdit=XX
setfocus>Regional*
GetControlText>Region*,ComboBox,2,npEdit
SetControlText>Region*,ComboBox,2,Syria
message>npEdit
---
I get a correct message, so the GetControlText works, but the SetControlText doesn't change anything. What am I doing wrong?
How to use SetControlText
Moderators: JRL, Dorian (MJT support)
You won't be able to change a ComboBox's value using SetControlText as other messages need to be fired to tell the application that it must update. To change a ComboBox value you will need to send keystrokes to simulate a user. If it is a ComboBox you should be able to just "Press Tab "to it and then "Send" the value you want it to be and this will select that value. If it is not an editable combo box then you will need to "Press Down" a number of times.
MJT Net Support
[email protected]
[email protected]