找回密码
 加入
搜索
查看: 1790|回复: 1

窗口切换操作问题,请求帮助

[复制链接]
发表于 2009-12-7 17:26:29 | 显示全部楼层 |阅读模式
献上源码:
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 362, 247, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1_1Close")
$Button1 = GUICtrlCreateButton("Button1", 16, 32, 75, 25, 0)
GUICtrlSetOnEvent($Button1, "Button1Click")
$Button2 = GUICtrlCreateButton("Button2", 16, 88, 75, 25, 0)
GUICtrlSetOnEvent($Button2, "Button2Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
Sleep(100)
WEnd

Func Form1_1Close()
Exit
EndFunc

Func Button1Click()
$Label1 = GUICtrlCreateLabel("这是测试标签", 160, 32, 76, 17)
$Button3 = GUICtrlCreateButton("测试", 168, 80, 75, 25, 0)
$Input1 = GUICtrlCreateInput("测试", 168, 120, 97, 21)
EndFunc

Func Button2Click()
$ListView = GUICtrlCreateListView(' 测试', 136, 16, 217, 185)
EndFunc
1、这个源码运行时,点按钮1正常,再点按钮2,切换正常。但是再点按钮1却回不去了。
2、先点按钮2正常,但是点按钮1,却是显示不正常。
以上两个问题请大侠指点,这个很实用哟。或者有什么替代的方式,能实现上述效果。
在线等!!!!!!!!!!!!!!!!!
发表于 2009-12-31 20:35:05 | 显示全部楼层
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 362, 247, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1_1Close")
$Button1 = GUICtrlCreateButton("Button1", 16, 32, 75, 25, 0)
GUICtrlSetOnEvent($Button1, "Button1Click")
$Button2 = GUICtrlCreateButton("Button2", 16, 88, 75, 25, 0)
GUICtrlSetOnEvent($Button2, "Button2Click")

$Label1 = GUICtrlCreateLabel("这是测试标签", 160, 32, 76, 17)
$Button3 = GUICtrlCreateButton("测试", 168, 80, 75, 25, 0)
$Input1 = GUICtrlCreateInput("测试", 168, 120, 97, 21)
$ListView = GUICtrlCreateListView(' 测试', 136, 16, 217, 185)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
Sleep(100)
WEnd

Func Form1_1Close()
Exit
EndFunc

Func Button1Click()
GUICtrlSetState ( $ListView, $GUI_HIDE )
GUICtrlSetState ( $Label1, $GUI_SHOW )
GUICtrlSetState ( $Button3, $GUI_SHOW )
GUICtrlSetState ( $Input1, $GUI_SHOW )
EndFunc

Func Button2Click()
GUICtrlSetState ( $Label1, $GUI_HIDE )
GUICtrlSetState ( $Button3, $GUI_HIDE )
GUICtrlSetState ( $Input1, $GUI_HIDE )
GUICtrlSetState ( $ListView, $GUI_SHOW )
EndFunc

并不是不能正常显示,而是你第二个窗口出现的控件把第一个窗口给档住了,所以看不到。方法很多种,要看你自己怎么用了。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-12-28 09:56 , Processed in 0.082670 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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