(已解决)同一个数组同一个值 结果却不一样?
本帖最后由 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 = $okbutton
_ArrayDisplay($msg)
MsgBox(0,'window','you press ok button')
Case $msg = $gui_event_closeAnd $msg = $mainwindow
_ArrayDisplay($msg)
MsgBox(0,'window','you close main window , exit...')
ExitLoop
EndSelect
WEnd
解决:$msg = guigetmsg(1)
这个$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)
$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
Case $mainwindow
Select
Case $msg = $okbutton
_ArrayDisplay($msg)
MsgBox(0, 'window', 'you press ok button')
GUISetState(@SW_HIDE,$mainwindow)
GUISetState(@SW_SHOW,$dummywindow)
Case $msg = $gui_event_close
_ArrayDisplay($msg)
MsgBox(0, 'window', 'you close main window , exit...')
ExitLoop
EndSelect
Case $dummywindow
Select
Case $msg = -3
_ArrayDisplay($msg)
GUISetState(@SW_HIDE,$dummywindow)
GUISetState(@SW_SHOW,$mainwindow)
Case $msg=$chlid_ok
_ArrayDisplay($msg)
EndSelect
EndSwitch
WEnd
看了你的代码 我想明白了 谢谢了
我也是老发现我现在连话都讲不好了 表达不出来心里想的事情 看来我这方面得多练习练习了
页:
[1]