Ich hab im Grunde alles so gemacht, wie es das Tutorial es auf https://www.autoitscript.com/wiki/Tabs beschrieben ist.
Code
#include <GUIConstantsEx.au3>
$hGUI = GUICreate("Test", 500, 500)
$cTab = GUICtrlCreateTab(10, 10, 480, 350)
$cTab_0 = GUICtrlCreateTabItem("Tab 0")
$cTab_1 = GUICtrlCreateTabItem("Tab 1")
GUICtrlCreateTabItem("")
$cButton = GUICtrlCreateButton("Add controls", 10, 450, 80, 30)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $cButton
; Correct
GUISwitch($hGUI, $cTab_0)
GUICtrlCreateLabel("Only on Tab 0", 40, 40, 200, 20)
GUICtrlSetBkColor(-1, 0xCCFFCC)
GUICtrlCreateTabItem("")
GUISwitch($hGUI)
; Incorrect
GUICtrlCreateLabel("OnTab 0 AND Tab 1", 40, 100, 200, 20)
GUICtrlSetBkColor(-1, 0xFFCCCC)
EndSwitch
WEnd
Alles anzeigen