找回密码
 加入
搜索
查看: 4203|回复: 6

[GUI管理] [已解决]往上不循環(這要如何改阿)

[复制链接]
发表于 2010-8-15 08:07:35 | 显示全部楼层 |阅读模式
本帖最后由 tcpuuu 于 2010-8-16 03:22 编辑


GUISetState()
Dim $bj = $L1
Dim $exe[3] = ['C:\程式1(aaa).exe', 'C:\程式2(bbb).exe', 'C:\程式3(ccc).exe']
While 1
        $msg = GUIGetMsg()
        Switch $msg
                Case -3
                        Exit
                Case $1Button To $3Button
                        Go($msg)
        EndSwitch
WEnd
Func Go($msg)
        If ($msg = $1Button And $bj = $L3) Or ($msg = $2Button And $bj = $L1) Then Return
        GUICtrlSetBkColor($bj, 0xFFFFFF)
        $bj += 1
        If $msg = $2Button Then $bj -= 2
        If $msg = $3Button And $bj = $L3 + 1 Then $bj = $L1
        GUICtrlSetBkColor($bj, 0xFF0000)
        MsgBox(0, 0, $exe[$bj - 3], 1)
EndFunc   ;==>Go
-------------------------------------------------------------
請教 板主afan !對不起 又來打擾
第1 上    往上不循環
第2 stop 不上也不下
第3  下     往下跑到3 -再按 - 循環到1
------------------------------------------
要如何修改!  我好久都不會  望請解答

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×

评分

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

查看全部评分

发表于 2010-8-15 09:04:07 | 显示全部楼层
本帖最后由 水木子 于 2010-8-15 09:05 编辑

afan前辈的影响力实在太大了,现在大家有问题都直接点名请他来帮忙了。

尔等需加油哦!

建议楼主修改下标题,目前的标题不方便大家搜索。
发表于 2010-8-15 10:28:37 | 显示全部楼层
能力有限,不知道你是不是要这样的效果,只做了“下”
Dim $exe[3] = ['C:\程式1(aaa).exe', 'C:\程式2(bbb).exe', 'C:\程式3(ccc).exe']
Local $nLocation = 3

GUICreate(" Win ", 200, 300)

$L1 = GUICtrlCreateLabel("1", 2, 2, 62, 36, 0x00800000) ;$WS_BORDER = 0x00800000
GUICtrlSetBkColor(-1, 0xFF0000)
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, 0xFFFFFF)
GUICtrlSetFont(-1, 24)

$1Button = GUICtrlCreateButton("上", 65, 1, 40, 30)
$2Button = GUICtrlCreateButton("下", 65, 31, 40, 30)
$3Button = GUICtrlCreateButton("Cycle", 65, 62, 40, 30)
GUISetState()

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case - 3
                        Exit
                Case $2Button
                        Go()
        EndSwitch
WEnd

Func Go()
        $nLocation += 1
        If $nLocation = 6 Then $nLocation = 3
        For $i = 3 To 5
                If $i = $nLocation Then
                        GUICtrlSetBkColor($i, 0xFF0000)
                        ContinueLoop
                EndIf
                GUICtrlSetBkColor($i, 0xFFFFFF)
        Next
EndFunc   ;==>Go

评分

参与人数 1威望 +2 收起 理由
afan + 2

查看全部评分

 楼主| 发表于 2010-8-15 12:16:38 | 显示全部楼层
謝謝水木子  回應
---------------------------
上不去  而且沒 執行'C:\程式1(aaa).exe', 'C:\程式2(bbb).exe', 'C:\程式3(ccc).exe'
我貼上原本 全文:
-------------------------
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, 0xFF0000)
GUICtrlSetFont(-1, 24)
$L3 = GUICtrlCreateLabel("3", 2, 78, 62, 36, 0x00800000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)
$1Button = GUICtrlCreateButton("down", 65, 1, 40, 30)
$2Button = GUICtrlCreateButton("up", 65, 31, 40, 30)
$3Button = GUICtrlCreateButton("Cycle", 65, 62, 40, 30)
GUISetState()
Dim $bj = $L2
Dim $exe[3] = ['C:\程式1(aaa).exe', 'C:\程式2(bbb).exe', 'C:\程式3(ccc).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)

        EndSwitch

WEnd



Func Go($msg)

        If ($msg = $1Button And $bj = $L3) 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)

EndFunc   ;==>Go

---------------------------------------------------------------------------------------
希望以下這樣"
-------------------
第1 鍵  上       往上跑到1 不再循環
第2 鍵  stop      不上也不下
第3  鍵   下     往下跑到3 -再按 - 循環到1
------------------------------------------------------
1個 不循環
1個 可 循環
1個 停在原地 再執行原地 .EXE1次
发表于 2010-8-15 12:21:20 | 显示全部楼层
回复 4# tcpuuu


這些功能好像前面都已經實現過了吧 — — ||
发表于 2010-8-15 13:54:14 | 显示全部楼层
GUICreate(" Win ", 150, 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, 0xFF0000)
GUICtrlSetFont(-1, 24)

$L3 = GUICtrlCreateLabel("3", 2, 78, 62, 36, 0x00800000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 24)

$1Button = GUICtrlCreateButton("往下要循環", 65, 1, 80, 30)
$2Button = GUICtrlCreateButton("原地執行", 65, 31, 80, 30)
$3Button = GUICtrlCreateButton("往上不循環", 65, 62, 80, 30)
GUISetState()

Dim $bj = $L2
Dim $exe[3] = ['C:\程式1(aaa).exe', 'C:\程式2(bbb).exe', 'C:\程式3(ccc).exe']
While 1
        $msg = GUIGetMsg()
        Switch $msg
                Case -3
                        Exit
                Case $1Button, $3Button
                        Go($msg)
                Case $2Button
                        MsgBox(0, 0, $exe[$bj - 3], 1)
        EndSwitch
WEnd

Func Go($msg)
        If ($msg = $3Button And $bj = $L1) Then Return ;Or ($msg = $3Button And $bj = $L1) 
        GUICtrlSetBkColor($bj, 0xFFFFFF)
        $bj += 1
        If $msg = $3Button Then $bj -= 2
        If $msg = $1Button And $bj = $L3 + 1 Then $bj = $L1
        GUICtrlSetBkColor($bj, 0xFF0000)
        MsgBox(0, 0, $exe[$bj - 3], 1)
EndFunc   ;==>Go
 楼主| 发表于 2010-8-15 22:51:35 | 显示全部楼层
afan 超级版主 您好! 非常感謝您的解說 (我的問題已解決)
現在我3種 都有了
("往下要循環")
("原地執行", )
("往上不循環",)
-----------------------
往下不循環
往上不循環
原地停
---------------
往上不循環
往下不循環
往上往下都循環
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-2 16:11 , Processed in 0.088976 second(s), 29 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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