回复 14# 872777825 Opt('GUIOnEventMode', 1)
Local $BTXL[5], $XLlist = 1, $XLspaceX = 60, $XLspaceY = 60, $XLbjx = 170, $XLbjy = 35
Local $BT[5], $list = 1, $spaceX = 60, $spaceY = 60, $bjx = 350, $bjy = 45
$Form1 = GUICreate('Form1', 623, 442)
GUISetOnEvent(-3, 'MYGUI_EVENT')
Local $aBtn[5][2] = [['C'],['D'],['E'],['F'],['退出']]
Local $aBtnx[5] = ['本地磁盘1', '本地磁盘2', '本地磁盘3', '本地磁盘4', '本地磁盘5']
For $i = 0 To UBound($BTXL) - 1
$aBtn[$i][1] = GUICtrlCreateButton($aBtn[$i][0], $XLspaceX * Mod($i, $XLlist) + $XLbjx, $XLspaceY * Floor($i / $XLlist) + $XLbjy, 160, 35)
GUICtrlSetOnEvent(-1, 'MYGUI_EVENT')
Next
For $i = 0 To UBound($BTXL) - 1
GUICtrlCreateLabel($aBtnx[$i], $spaceX * Mod($i, $list) + $bjx, $spaceY * Floor($i / $list) + $bjy, 160, 35)
Next
GUISetState()
While 1
Sleep(100)
WEnd
Func _Exit()
GUIDelete($Form1)
Exit
EndFunc ;==>_Exit
Func MYGUI_EVENT()
Switch @GUI_CtrlId
Case -3
Exit
Case $aBtn[0][1] To $aBtn[4][1]
MsgBox(0, '右边文本', $aBtnx[@GUI_CtrlId - $aBtn[0][1]])
If @GUI_CtrlId = $aBtn[4][1] Then Exit
EndSwitch
EndFunc ;==>MYGUI_EVENT
|