找回密码
 加入
搜索
查看: 4184|回复: 7

[GUI管理] [已解決]求助(afan 超级版主) 往上退2格,向下進1格該如何?

  [复制链接]
发表于 2010-8-19 05:47:25 | 显示全部楼层 |阅读模式
本帖最后由 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[6] = ["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
感謝!

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-8-19 08:10:05 | 显示全部楼层
本帖最后由 水木子 于 2010-8-19 11:50 编辑

呵呵!估计afan前辈也要烦了,自己学着思考、自己做吧!

別人始終只能幫你一時,幫不了你一世。(TNND 咋是繁體字,輸入法有問題)
 楼主| 发表于 2010-8-19 09:43:29 | 显示全部楼层
水木子 超级版主
您好 您可解答嗎?  ---謝謝---

還要如果來到2 再退 只能退到1
发表于 2010-8-19 11:51:26 | 显示全部楼层
回复 3# tcpuuu

最近忒忙,心情忒郁闷!
 楼主| 发表于 2010-8-19 11:57:13 | 显示全部楼层
拜託一下 我自己 試2天了 都不會
才跑來求教...
发表于 2010-8-19 12:40:09 | 显示全部楼层
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[6] = ["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
发表于 2010-8-19 12:41:49 | 显示全部楼层
就改了第51行的2改为3,另外增加了第52行。
 楼主| 发表于 2010-8-19 13:05:32 | 显示全部楼层
感恩 ㄚ!
謝謝afan 超级版主
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-2 19:27 , Processed in 0.080497 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表