[已解決]求助(afan 超级版主) 往上退2格,向下進1格該如何?
本帖最后由 tcpuuu 于 2010-8-23 04:59 编辑GUICreate(" Win ", 110, 302, 800, 2);A1, 8#代? 第4行與第8行調換,第20改為 Dim $bj = $L2 即可。
$L1 = GUICtrlCreateLabel("1", 2, 2, 62, 36, 0x00800000) ;$WS_BORDER = 0x00800000
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)
$L2 = GUICtrlCreateLabel("2", 2, 40, 62, 36, 0x00800000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)
$L3 = GUICtrlCreateLabel("3", 2, 78, 62, 36, 0x00800000)
GUICtrlSetBkColor(-1, 0xFF0000)
GUICtrlSetFont(-1, 24)
$L4 = GUICtrlCreateLabel("4", 2, 116, 62, 36, 0x00800000) ;$WS_BORDER = 0x00800000
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)
$L5 = GUICtrlCreateLabel("5", 2, 154, 62, 36, 0x00800000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)
$L6 = GUICtrlCreateLabel("6", 2, 192, 62, 36, 0x00800000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)
$1Button = GUICtrlCreateButton("往下進1格", 65, 1, 40, 30)
$2Button = GUICtrlCreateButton("往上退2格", 65, 31, 40, 30)
$3Button = GUICtrlCreateButton("原地", 65, 62, 40, 30)
GUISetState()
Dim $bj = $L3
Dim $exe = ["1.exe", "2.exe", "3.exe", "4.exe", "5.exe", "6.exe"]
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit
Case $1Button To $2Button
Go($msg)
Case $3Button
MsgBox(0, 0, $exe[$bj - 3], 1)
;RUN($exe[$bj - 3])
EndSwitch
WEnd
Func Go($msg)
If ($msg = $1Button And $bj = $L6) Or ($msg = $2Button And $bj = $L1) Then Return
GUICtrlSetBkColor($bj, 0xFFFFFF)
$bj += 1
If $msg = $2Button Then $bj -= 2
GUICtrlSetBkColor($bj, 0xFF0000)
MsgBox(0, 0, $exe[$bj - 3], 1)
;RUN($exe[$bj - 3])
EndFunc ;==>Go
======================================================
求助(afan 超级版主) 往上退2格,向下進1格該如何,不循環
如果來到2再退 只能退到1
感謝! 本帖最后由 水木子 于 2010-8-19 11:50 编辑
呵呵!估计afan前辈也要烦了,自己学着思考、自己做吧!
別人始終只能幫你一時,幫不了你一世。(TNND 咋是繁體字,輸入法有問題) 水木子 超级版主
您好 您可解答嗎?---謝謝---
還要如果來到2 再退 只能退到1 回复 3# tcpuuu
最近忒忙,心情忒郁闷!{:face (229):} 拜託一下 我自己 試2天了 都不會
才跑來求教... GUICreate(" Win ", 110, 302, 800, 2)
$L1 = GUICtrlCreateLabel("1", 2, 2, 62, 36, 0x00800000) ;$WS_BORDER = 0x00800000
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)
$L2 = GUICtrlCreateLabel("2", 2, 40, 62, 36, 0x00800000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)
$L3 = GUICtrlCreateLabel("3", 2, 78, 62, 36, 0x00800000)
GUICtrlSetBkColor(-1, 0xFF0000)
GUICtrlSetFont(-1, 24)
$L4 = GUICtrlCreateLabel("4", 2, 116, 62, 36, 0x00800000) ;$WS_BORDER = 0x00800000
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)
$L5 = GUICtrlCreateLabel("5", 2, 154, 62, 36, 0x00800000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)
$L6 = GUICtrlCreateLabel("6", 2, 192, 62, 36, 0x00800000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)
$1Button = GUICtrlCreateButton("往下進1格", 65, 1, 40, 30)
$2Button = GUICtrlCreateButton("往上退2格", 65, 31, 40, 30)
$3Button = GUICtrlCreateButton("原地", 65, 62, 40, 30)
GUISetState()
Dim $bj = $L3
Dim $exe = ["1.exe", "2.exe", "3.exe", "4.exe", "5.exe", "6.exe"]
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit
Case $1Button To $2Button
Go($msg)
Case $3Button
MsgBox(0, 0, $exe[$bj - 3], 1)
;RUN($exe[$bj - 3])
EndSwitch
WEnd
Func Go($msg)
If ($msg = $1Button And $bj = $L6) Or ($msg = $2Button And $bj = $L1) Then Return
GUICtrlSetBkColor($bj, 0xFFFFFF)
$bj += 1
If $msg = $2Button Then $bj -= 3
If $bj < $L1 Then $bj = $L1
GUICtrlSetBkColor($bj, 0xFF0000)
MsgBox(0, 0, $exe[$bj - 3], 1)
;RUN($exe[$bj - 3])
EndFunc ;==>Go
就改了第51行的2改为3,另外增加了第52行。 感恩 ㄚ!
謝謝afan 超级版主
页:
[1]