找回密码
 加入
搜索
查看: 1901|回复: 2

[AU3基础] (已解决)同一个数组同一个值 结果却不一样?

[复制链接]
发表于 2011-4-3 21:58:38 | 显示全部楼层 |阅读模式
本帖最后由 yarsye 于 2011-4-29 14:25 编辑

同个数组 值却不一样 _ArrayDisplay($msg)
#include <GUIConstantsEX.au3>
#include <array.au3>

$mainwindow = GUICreate('Hello , world',200,100)
GUICtrlCreateLabel('how are you?',30,10)
$okbutton = GUICtrlCreateButton('OK',70,50,60)

$dummywindow = GUICreate('test',200,100)

GUISwitch($mainwindow)
GUISetState(@SW_SHOW)

While 1
        $msg = GUIGetMsg(1)
        
        Select 
                Case $msg[0] = $okbutton
                        _ArrayDisplay($msg)
                        MsgBox(0,'window','you press ok button')
                        
                Case $msg[0] = $gui_event_close  And $msg[1] = $mainwindow
                        _ArrayDisplay($msg)
                        MsgBox(0,'window','you close main window , exit...')
                        ExitLoop
        EndSelect
WEnd
解决:$msg = guigetmsg(1)

这个$msg当点击不同的面板,值应该就是不一样的,是我错了
发表于 2011-4-3 22:23:18 | 显示全部楼层
表达的是什么意思呢?不大理解,只能猜了
#include <GUIConstantsEX.au3>
#include <array.au3>

$mainwindow = GUICreate('Hello , world', 200, 100)
GUICtrlCreateLabel('how are you?', 30, 10)
$okbutton = GUICtrlCreateButton('OK', 70, 50, 60)

$dummywindow = GUICreate('test', 200, 100)
$chlid_ok=GUICtrlCreateButton("chlid_ok",70,50,60)

GUISwitch($mainwindow)
GUISetState(@SW_HIDE,$dummywindow)
GUISetState(@SW_SHOW,$mainwindow)



While 1
        $msg = GUIGetMsg(1)
        Switch $msg[1]
                Case $mainwindow
                        Select
                                Case $msg[0] = $okbutton
                                        _ArrayDisplay($msg)
                                        MsgBox(0, 'window', 'you press ok button')                                        
                                        GUISetState(@SW_HIDE,$mainwindow)
                                        GUISetState(@SW_SHOW,$dummywindow)
                                Case $msg[0] = $gui_event_close 
                                        _ArrayDisplay($msg)
                                        MsgBox(0, 'window', 'you close main window , exit...')
                                        ExitLoop
                        EndSelect
                Case $dummywindow
                        Select
                                Case $msg[0] = -3
                                        _ArrayDisplay($msg)
                                        GUISetState(@SW_HIDE,$dummywindow)
                                        GUISetState(@SW_SHOW,$mainwindow)
                                Case $msg[0]=$chlid_ok
                                        _ArrayDisplay($msg)
                        EndSelect
        EndSwitch
        
WEnd
 楼主| 发表于 2011-4-4 09:27:24 | 显示全部楼层
看了你的代码 我想明白了 谢谢了

我也是老发现我现在连话都讲不好了 表达不出来心里想的事情 看来我这方面得多练习练习了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-10-2 10:25 , Processed in 0.082400 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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