托盘中的每一个菜单,都对应一个窗体($Form)。每点击一个菜单时,打开对应的窗体,请教高手下面的代码要怎么改?或给个其它的办法。。。。Opt("GUIOnEventMode", 1)
Opt("TrayOnEventMode",1)
Opt("TrayAutoPause",0)
Opt("TrayMenuMode",1)
;双击显示界面, 右击打开菜单
TraySetClick(12)
TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE,"_TrayEvent")
TraySetOnEvent($TRAY_EVENT_SECONDARYDOWN,"_TrayEvent")
$TrayItem1 = TrayCreateItem("窗体1")
TrayCreateItem("")
$TrayItem2 = TrayCreateItem("窗体2")
TrayCreateItem("")
$Exit = TrayCreateItem("退出")
TrayItemSetOnEvent(-1,"_TrayEvent")
TraySetState()
#Region ### START Koda GUI section ### Form=Hsy_Shop.kxf
$Form1 = GUICreate("窗体1", 282, 162, 366, 349, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
GUISetState(@SW_HIDE, $Form1)
$Form2 = GUICreate("窗体2", 369, 169, 313, 245, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
GUISetState(@SW_HIDE, $Form2)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
;_TrayEvent
Func _TrayEvent()
Switch @TRAY_ID
Case $TrayItem1
GUISetState(@SW_SHOW, $Form1)
Case $TrayItem2
GUISetState(@SW_SHOW, $Form2)
Case $Exit
_Exit()
EndSwitch
EndFunc
;_GUIEvent
Func _GUIEvent()
EndFunc
|