脚本如下:
gui, Add, Text ,Section,DDL
gui, Add, Text ,,DDL1
gui,Add, DDL, ys vmyddl gAction,||a|b|c
gui,Add, DDL, vmyddl1,a|b|c
gui, Add, Button,ys gbbt,Select b in DDL
gui, Show
return
Action:
GuiControlGet, Controltxt,, %A_GuiControl%
GuiControlGet, ControlHwnd,Hwnd,%A_GuiControl%
WinGetClass, class, ahk_id %ControlHwnd%
GuiControl,ChooseString,% A_GuiControl “1”,% Controltxt
MsgBox % “Hwnd=” ControlHwnd “`nclass=” class “`nControltxt=” Controltxt “`nA_GuiControl=” A_GuiControl
return
bbt:
guicontrol, ChooseString, myddl, b
return
—————
想利用button-bbt让myddl选择b,同时触动Action,自动选择myddl1的b选项