论坛已有相关帖子了#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
While 1
;$reset = False
$Form1 = GUICreate(" 如何在主窗口中弹出一个列表对话框", 400, 200, 200, 200)
$Button1 = GUICtrlCreateButton("开始", 150, 144, 121, 33, 0)
$Form2 = GUICreate("列表对话框", 200, 200, 200, 200)
$Button2 = GUICtrlCreateButton("确定", 24, 40, 121, 33, 0)
GUICtrlCreateCombo("请选择", 24, 10, 121, 33)
GUISetState(@SW_SHOW, $Form1)
While 1
$nMsg = GUIGetMsg(1)
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
If $nMsg[1] == $Form1 Then
Exit
ElseIf $nMsg[1] == $Form2 Then
GUISetState(@SW_SHOW, $Form1)
GUISetState(@SW_HIDE, $Form2)
EndIf
Case $Button1
GUISetState(@SW_SHOW, $Form2)
GUISetState(@SW_HIDE, $Form1)
Case $Button2
GUISetState(@SW_SHOW, $Form1)
GUISetState(@SW_HIDE, $Form2)
;$reset = True
EndSwitch
;If $reset = False Then ExitLoop
WEnd
WEnd
|