可參考如下代碼#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = Guicreate("GUI 設計編輯區", 400, 400, -1, -1)
$SoftMenu = GUICtrlCreateMenu("功能")
$SoftVersion = GUICtrlCreateMenu("")
GUICtrlSetState($SoftVersion,$GUI_DISABLE)
$Softitem1 = GUICtrlCreateMenuItem("TEST1",$SoftMenu)
$Softitem2 = GUICtrlCreateMenuItem("TEST2",$SoftMenu)
$Softitem3 = GUICtrlCreateMenuItem("TEST3",$SoftMenu)
$Softitem4 = GUICtrlCreateMenuItem("TEST4",$SoftMenu)
$Softitem5 = GUICtrlCreateMenuItem("TEST5",$SoftMenu)
$Softitem6 = GUICtrlCreateMenuItem("TEST6",$SoftMenu)
GuiSetState(@SW_SHOW)
While 1
$Msg = GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
Exit
Case $Softitem1
msgbox(0,"溫馨提示","選中的是TEST1的子項目")
Case $Softitem2
msgbox(0,"溫馨提示","選中的是TEST2的子項目")
Case $Softitem3
msgbox(0,"溫馨提示","選中的是TEST3的子項目")
Case $Softitem4
msgbox(0,"溫馨提示","選中的是TEST4的子項目")
Case $Softitem5
msgbox(0,"溫馨提示","選中的是TEST5的子項目")
Case $Softitem6
msgbox(0,"溫馨提示","選中的是TEST6的子項目")
EndSwitch
Wend
|