谢谢大侠,看来au3只能做到这样了,没有想到同一窗口下不能建立两个Tab,是au3的缺点 回复 17# qsy666888
說話很奇怪
13樓範例 不就是 同一個窗口建立兩個 TAB???
不然13樓範例叫做甚麼?? 回复 18# kk_lee69
13楼例子,不能在标签框里建控件,建一个控件,四个标签框里面都有这个控件 不知道还有没有更好的处理方法 回复 19# qsy666888
能不能秀出你的 程式碼 回复 19# qsy666888
http://www.autoit3.cn/forum.php?mod=viewthread&tid=52174&highlight=%B6%E0%B2%E3TAB
http://www.autoit3.cn/forum.php?mod=viewthread&tid=1580&highlight=%B6%E0TAB 回复 21# kk_lee69
就是上一个贴子的那个软件,只是把框架弄好了,还没有写入功能,如果需要,发出来就是了 回复 23# qsy666888
参考了一下22楼提供的代码~ 知道了为啥标题变灰,感谢提供链接~因为我之前都是制作无标题的窗口,自己再做标题出来~ 修改了一下代码就可以了
至于楼主你说的窗口最大化这个,可以自己写个判断来调整子窗口
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <DateTimeConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 437, -1, -1)
$Button1 = GUICtrlCreateButton("第一按钮", 512, 64, 75, 25)
$Button2 = GUICtrlCreateButton("第二按钮", 512, 120, 75, 25)
$Form2 = GUICreate("", 417, 305, 14, 28, $WS_CHILD, -1, $Form1)
$Form3 = GUICreate("", 417, 305, 14, 28, $WS_CHILD, -1, $Form1)
GUISetState(@SW_SHOW, $Form1)
GUISetState(@SW_SHOW, $Form2)
GUISetState(@SW_SHOW, $Form3)
GUISwitch($Form2)
$Tab1 = GUICtrlCreateTab(24, 48, 417, 305)
$TabSheet1 = GUICtrlCreateTabItem("第一个按钮标签1")
$Label1 = GUICtrlCreateLabel("Label1", 80, 96, 36, 17)
$Input1 = GUICtrlCreateInput("Input1", 48, 128, 121, 21)
$Input2 = GUICtrlCreateInput("Input2", 48, 152, 121, 21)
$Combo1 = GUICtrlCreateCombo("Combo1", 48, 184, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Date1 = GUICtrlCreateDate("2018/03/16 06:51:11", 48, 208, 186, 21)
$Group1 = GUICtrlCreateGroup("Group1", 216, 96, 185, 105)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button3 = GUICtrlCreateButton("Button3", 72, 248, 75, 25)
$TabSheet2 = GUICtrlCreateTabItem("第一按钮标签2")
;GUICtrlSetState(-1,$GUI_SHOW)
$Label2 = GUICtrlCreateLabel("Label2", 96, 88, 36, 17)
$Group2 = GUICtrlCreateGroup("Group2", 208, 104, 185, 105)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input3 = GUICtrlCreateInput("Input3", 56, 152, 121, 21)
$Input4 = GUICtrlCreateInput("Input4", 56, 176, 121, 21)
$Combo2 = GUICtrlCreateCombo("Combo2", 56, 200, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Date2 = GUICtrlCreateDate("2018/03/16 06:52:54", 48, 224, 186, 21)
$Button4 = GUICtrlCreateButton("Button4", 80, 264, 75, 25)
GUICtrlCreateTabItem("")
GUISwitch($Form3)
$Tab2 = GUICtrlCreateTab(24, 48, 417, 305)
$TabSheet3 = GUICtrlCreateTabItem("第二个按钮标签1")
$Label3 = GUICtrlCreateLabel("Label1", 80, 96, 36, 17)
$Input5 = GUICtrlCreateInput("Input1", 48, 128, 121, 21)
$Input6 = GUICtrlCreateInput("Input2", 48, 152, 121, 21)
$Combo3 = GUICtrlCreateCombo("Combo1", 48, 184, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Date3 = GUICtrlCreateDate("2018/03/16 06:51:11", 48, 208, 186, 21)
$Group3 = GUICtrlCreateGroup("Group1", 216, 96, 185, 105)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button5 = GUICtrlCreateButton("Button3", 72, 248, 75, 25)
$TabSheet4 = GUICtrlCreateTabItem("第二按钮标签2")
GUICtrlSetState(-1,$GUI_SHOW)
$Group2 = GUICtrlCreateGroup("Group2", 224, 80, 185, 41)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button6 = GUICtrlCreateButton("Button4", 40, 88, 75, 25)
$Button7 = GUICtrlCreateButton("Button5", 120, 88, 75, 25)
$ListView1 = GUICtrlCreateListView("", 32, 128, 250, 150)
$TreeView1 = GUICtrlCreateTreeView(288, 128, 113, 209)
GUICtrlCreateTabItem("")
GUISetState(@SW_HIDE, $Form3)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUISetState(@SW_SHOW, $Form2)
GUISetState(@SW_HIDE, $Form3)
Case $Button2
GUISetState(@SW_SHOW, $Form3)
GUISetState(@SW_HIDE, $Form2)
EndSwitch
WEnd
回复 24# austere
感谢大虾和22楼kk-lee69大虾提供帮助,看来au3还是比较强大 你这个就是想要在一个窗口同位置有多个标签控件,按道理13楼的方法是对的,使用用户函数的标签控件管理,_GUICtrlTab_Create是能创建多个标签的,实际使用有问题那应该是这个函数的问题,有高手修改好它吗。
页:
1
[2]