楼主可以尝试这样建TAB
[au3]#include <GUIConstants.au3>
#include <WindowsConstants.au3>
Dim $width = 780, $height = 650, $left = 20, $top = 8
$main_GUI = GUICreate("公交查询系统", $width, $height, -1, -1)
GUISetState()
$child1 = GUICreate("", $width - 24, $height - 84, 12, 81, BitOR($WS_CHILD, $WS_TABSTOP), -1, $main_GUI)
$contextmenu = GUICtrlCreateContextMenu ()
$newsubmenu = GUICtrlCreateMenu ("new", $contextmenu)
$textitem = GUICtrlCreateMenuitem ("text", $newsubmenu)
$fileitem = GUICtrlCreateMenuitem ("Open", $contextmenu)
$saveitem = GUICtrlCreateMenuitem ("Save", $contextmenu)
GUISetBkColor(0xFFFFFF)
;~ gonggao($gonggao)
GUISetState()
$child2 = GUICreate("", $width - 24, $height - 84, 12, 81, BitOR($WS_CHILD, $WS_TABSTOP), -1, $main_GUI)
GUISetBkColor(0xFFFFFF)
GUICtrlCreateTabItem("")
;~ xianlulist(0)
GUISetState()
GUISwitch($main_GUI)
$main_tab = GUICtrlCreateTab(10, 60, $width - 18, $height - 80)
$main_tabitem1 = GUICtrlCreateTabItem("公告")
$main_tabitem2 = GUICtrlCreateTabItem("线路查询")
GUICtrlCreateTabItem("")
GUICtrlSetFont($main_tab, 10)
GUICtrlSetState($main_tabitem1, $GUI_SHOW)
GUISwitch($child1)
While 1
$nmsg = GUIGetMsg()
Switch $nmsg
Case $main_tab
$tabidx = GUICtrlRead($main_tab)
;~ MsgBox(0,0,$tabidx)
Select
Case $tabidx = 0
GUISetState(@SW_HIDE, $child2)
GUISetState(@SW_SHOW, $child1)
Case $tabidx = 1
GUISetState(@SW_HIDE, $child1)
GUISetState(@SW_SHOW, $child2)
Case Else
EndSelect
Case $GUI_EVENT_CLOSE
exit
EndSwitch
WEnd[/au3] |