nekin 发表于 2010-5-5 20:15:22

如何选择下拉列表的某一项?

在运行某个应用程序的时候,怎么选择下拉列表的某一项?
如图片,我怎么能直接选择Custom ?

nekin 发表于 2010-5-5 20:57:53

希望大家帮帮忙,我很着急!

lanfengc 发表于 2010-5-5 21:08:58

#include <GUIConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 290, 150, 192, 124)
$Combo1 = GUICtrlCreateCombo("", 64, 56, 169, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "这是第一个|2|3|4|5|6")
ControlSetText($Form1,"",$Combo1,"2")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
代码如上

nekin 发表于 2010-5-6 09:00:31

回复 3# lanfengc


    谢谢啊!
    如果是某个应用程序,自动运行,如何直接选择custom执行下一步啊?

lanfengc 发表于 2010-5-6 12:31:58

ControlSetText($Form1,"",$Combo1,"2")
看看这个函数的用法。

lpxx 发表于 2010-5-7 00:37:37

代码如上
lanfengc 发表于 2010-5-5 21:08 http://www.autoitx.com/images/common/back.gif


    你这样解释大家不都明白了吗?谢谢,你是好人。

dajun 发表于 2010-5-7 07:08:26

很好,记下!
页: [1]
查看完整版本: 如何选择下拉列表的某一项?