AutoIT - 如何从下拉列表中选择值(组合框)

时间:2016-04-11 07:02:55

标签: autoit

我正在使用AutoIT自动化Windows应用程序。作为其中的一部分,我尝试从下拉列表中选择值,但我无法选择值。以下是我的代码。

ControlCommand("Database Select","", "[Name:db_comboBox]", "ShowDropDown") ControlCommand("DatabaseSelect","","Name:db_comboBox]","SelectString",'Test') ControlCommand("Database Select","Main Load Settings", "[Name:db_comboBox]", "HideDropDown")

任何人都可以帮助我如何从下拉菜单中选择价值。

3 个答案:

答案 0 :(得分:2)

Milos,感谢您的帮助,下面的代码解决了我的问题。

  ControlClick("Database Select", "", "[Name:db_comboBox]")
  While 1
    Send("{DOWN}")
    $ctext=ControlGetText("Database Select","","[Name:db_comboBox]")
    If $ctext="DB_UKTEST" Then
        ExitLoop
    EndIf
  WEnd

答案 1 :(得分:1)

这对我有用 ControlSend(" Print",""," ComboBox1"," [Name:Microsoft Print to PDF]")

答案 2 :(得分:0)

这对我有用:

WinWaitActive ("Options (User-Mode)")
ControlCommand("Options (User-Mode)" , "" , "ComboBox1" , "SelectString" , "VNC password")