求解,GUI多窗口怎么也打不开?
本帖最后由 sunny617 于 2009-7-10 20:47 编辑#include <GuiConstantsEx.au3>
#include <AVIConstants.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
#include <INet.au3>
#Include <date.au3>
#include <IE.au3>
Global $mune1, $mune2, $mune3,$mune4,$mune5,$BS_FLAT, $BS_CENTER
HotKeySet("{F1}","help")
Opt("TrayAutoPause",0)
Opt("TrayOnEventMode",1)
$IPadder =IniRead("system.ini","Default","IPadder","0.0.0.0")
;GUI
$Win=GUICreate("my test 江湖",400,400,700,350)
GUISetIcon(@SystemDir &"",0)
;mune
$mune1 = GUICtrlCreateMenu("文件[&F]")
$next_mune1= GUICtrlCreateMenuItem("退出程序[&X]",$mune1)
$mune6 = GUICtrlCreateMenu("帮助[&H]")
$help_1=GUICtrlCreateMenuItem("帮助文档[&H]",$mune6)
$help_mune6= GUISetIcon(@MyDocumentsDir &'\help.txt',0)
;-----------Tab---------------------------
$Mainwindowtab = GUICtrlCreateTab(4,2,386,280,-1,Default)
GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$Tab0=GUICtrlCreateTabItem("Reboot Set")
$Tab0_tabel=GUICtrlCreateLabel("此顶是自动重启用处!",250,260,200)
$Tab0_color=GUICtrlSetColor($Tab0_tabel,0xFF0000)
GUICtrlSetFont($Tab0_tabel, 8, 600, 0, "Comic Sans MS")
$Button_tab0=GUICtrlCreateButton("Network Settings",260,230,Default,Default,$BS_FLAT & $BS_CENTER)
$Button_color=GUICtrlSetColor($Button_tab0,0x000080)
GUICtrlSetFont($Button_tab0, 9, 800, 0, "MS Sans Serif")
$Group_1=GUICtrlCreateGroup("开始<启动程序>",8,30,370,200)
$groupfont=GUICtrlSetFont(-1, 9, 800, 0, "Comic Sans MS")
$Table1=GUICtrlCreateLabel("IP :",20,60)
GUICtrlSetColor($Table1,0x321205)
$Table2=GUICtrlCreateLabel("统计 :",20,90)
GUICtrlSetColor($Table2,0x321205)
$Table2=GUICtrlCreateLabel("开始时间 :",20,120)
GUICtrlSetColor($Table2,0x321205)
$Table3=GUICtrlCreateLabel("结束时间 :",20,150)
GUICtrlSetColor($Table3,0x321205)
$Label4 = GUICtrlCreateLabel("",40,60,190,17)
$Label5 = GUICtrlCreateLabel(" 0(successful!)",70, 90, 190, 17)
$Label6 = GUICtrlCreateLabel("00年/00月/00日 00时/00分/00秒", 80, 120, 190, 17)
$Label7 = GUICtrlCreateLabel("00年/00月/00日 00时/00分/00秒", 80, 150, 190, 17)
$Label8= GUICtrlCreateLabel("Grandstream Networks Inc. (china)", 20, 350,300,12,1)
GUICtrlSetColor(-1, 0x808080)
GUICtrlCreateGroup("", -99, -99, 12, 1)
autoitsetoption("TrayAutoPause",0)
$Tab1=GUICtrlCreateTabItem("System UP")
$win_Childw = GUICreate("network settings Top mesh",400,200,700,450)
GUISwitch($Win)
GUISetState(@SW_SHOW)
#EndRegion ### START Koda GUI section ### Form====================================
GuiSetState()
Func now_calc()
$var = Ping($IPadder,10)
If $var Then ; also possible: If @error = 0 Then ...
$now_calc = _NowCalc()
GUICtrlSetData ($Label6,$now_calc)
Else
MsgBox(0,"Internet connection","Network is impassability~"&@CR&"Please check the equipment and network!")
EndIf
EndFunc
Sleep(3000)
$Dot = "."
GUICtrlSetFont($Dot, 9, 900, 0, "Comic Sans MS")
AdlibEnable("_conut" ,1000)
While 1
$nmsg = GUIGetMsg()
Select
Case $nmsg= $GUI_EVENT_CLOSE
If MsgBox(1,"警告","你真的要退出吗?")=1 Then ;当选为1时msgbox反回控件信息
ExitLoop
EndIf
Case $nmsg= $next_mune1
ExitLoop
Case $nmsg=$help_1
help()
Switch $nmsg
Case $Button_tab0
GUISwitch($win_Childw) ;切换当前窗口到子窗口
GUISetState(@SW_HIDE)
EndSwitch
EndSelect
WEnd
Func help()
ShellExecute("help.txt")
EndFunc ;==>help
Func _conut()
$Dot = $Dot & "."
If StringLen($Dot) > 6 Then $Dot = "."
GUICtrlSetData($Group_1, "加载中" & $Dot)
EndFunc
----------------------------------------------------
:face (36):
$Button_tab0怎么就打不开$win_Childw
我想了一个下午。。看了论坛还是打不开?:face (35): 本帖最后由 lynfr8 于 2009-7-10 13:38 编辑
While 1
$nmsg = GUIGetMsg()
Select
Case $nmsg= $GUI_EVENT_CLOSE
If MsgBox(1,"警告","你真的要退出吗?")=1 Then ;当选为1时msgbox反回控件信息
ExitLoop
EndIf
Case $nmsg= $next_mune1
ExitLoop
Case $nmsg=$help_1
help()
Case $nmsg= $Button_tab0
GUISwitch($win_Childw) ;切换当前窗口到子窗口
GUISetState(@SW_SHOW)
EndSelect
WEnd
只解决你提问的,建议其他的自己研究 :face (30):。。。。。。。。还是打不开?
为什么。。为什么捏 :face (3):
继续项起。。。。。。。求解啊 :face (7):高手呢。,。。。没有人路过:face (32): 我打开了子窗口
怎么做才能不让父窗口点出来。。。就是当我子窗口没关时点不到父窗口的那种。。。
还有个问题?为什么在父窗口设置的关闭操作,在子窗口上点关闭把父窗口也给关了呢
:face (13): http://www.autoitx.com/forum.php?mod=viewthread&tid=173
多窗口的操作论坛资料也不少
还是建议楼主借鉴下再多些尝试自行解决
页:
[1]