Jump to content

Not able to use ControlCommand with a ComboBox


Recommended Posts

Hi there.

It's my first time here, I just know the basics about programming and I'm taking a look to the @Morthawt tutorials to learn how to start with AutoIt.

So far, I think I'm understanding most of things, and most of things seems to work properly, but I'm not able to select certain option from a combobox using the ControlCommand function. I can select it using ControlSend and the strings {DOWN}{DOWN}{ENTER}, but the list of elements can be different from time to time, so I'd like to it the most precise way as posible.

I did this very simple Windows Form using Visual Studio 2022 to check if what happens with other program also happens with something I do.

image.png.3064232ace68614575123d1257c0a5aa.png

image.png.fb9308fe2646bac95da06d93efa88442.png

I'm interested on using SelectString and SetCurrentSelection through ControlCommand, but any of them seems to work.

I tried:

ControlCommand("Form1", "", 
Followed by these different things (I tried more but I think these ones should be enough):

  • "[NAME:comboBox1]"
  • "[CLASS:WindowsForms10.COMBOBOX.app.0.141b42a_r8_ad1; INSTANCE: 1]"
  • "[CLASSNN:WindowsForms10.COMBOBOX.app.0.141b42a_r8_ad11]"

And ended with

"SelectString", 'prueba2')

I get 0 if I try to storage the result on a variable.

And it gets inside @error conditional.

Just let me know if I need to be more precise about some of these problems or if there is some tip to , thanks in advance.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...