窗口控件之间不能切换操作
本帖最后由 neity 于 2009-12-7 20:19 编辑不好意思,帖子发错了,再次发一次。请版主不要误会,绝不是灌水。
献上源码:
#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,却是显示不正常。
以上两个问题请大侠指点,这个很实用哟。或者有什么替代的方式,能实现上述效果。
在线等!!!!!!!!!!!!!!!!! 道理很简单,按钮2形成的控件listview挡住了按钮1形成的控件。#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 ###
Dim $Label1,$Button3,$Input1,$ListView
While 1
Sleep(100)
WEnd
Func Form1_1Close()
Exit
EndFunc
Func Button1Click()
GUICtrlDelete($ListView )
$Label1 = GUICtrlCreateLabel("这是测试标签", 160, 32, 76, 17)
$Button3 = GUICtrlCreateButton("测试", 168, 80, 75, 25, 0)
$Input1 = GUICtrlCreateInput("测试", 168, 120, 97, 21)
EndFunc
Func Button2Click()
GUICtrlDelete($Label1)
GUICtrlDelete($Button3)
GUICtrlDelete($Input1)
$ListView = GUICtrlCreateListView(' 测试', 136, 16, 217, 185)
EndFunc
谢谢了,帮了大忙,再次谢谢
页:
[1]