Jump to content

[Combobox] Right way to put focus + select item?

Recommended Posts


I'm an AutoIT newbie, and need to select an item in a combobox. I googled for this, but would like to check what's the right way to solve this.

The combobox control I need to click on and select an item from is class=TbsSkinOfficeComboBox.

Should I use this, or is there a better way?

;Which should I choose?

#include <GUIConstantsEx.au3>

ControlCommand("My GUI", "", "[CLASS:TbsSkinOfficeComboBox; INSTANCE:1]", "SelectString", "item2")

Thank you.

Link to post
Share on other sites

I made a bit of progress understanding how AutoIT works with controls, but the following code doesn't work: The script just waits doing nothing, although the application is running with its window maximized:

#region --- Internal functions Au3Recorder Start ---

Func _Au3RecordSetup()

Func _WinWaitActivate($title,$text,$timeout=0)
If Not WinActive($title,$text) Then WinActivate($title,$text)

#endregion --- Internal functions Au3Recorder End ---

ControlClick("[CLASS:TfrmHome]", "", "[ID:2164966]")

Can someone spot what's wrong with the above?

Thank you.

Edited by littlebigman
Link to post
Share on other sites

Thanks for the help. I found what it was: The following code as generated by Au3Recorder doesn't work:


This works:

;time out after 10s
;BAD _WinWaitActivate("classname=TfrmHome","",5)

MsgBox(64, "My title", "My text")

Bottom line: Although it should be a great help for newbies to get started with AutoIT, Au3Recorder is to be avoided.

Thank you.

Edited by littlebigman
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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...