Hallo Apfeltasche,
ich hätte da einen Ansatz für Dich.
Hab das jetzt nicht mit Tab's probiert, geht aber bestimmt auch.
Ist natürlich nur ein Ansatz und weit entfernt davon perfekt zu sein.
Ich denke aber das kann man ausbauen...
Spoiler anzeigen
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <GuiTab.au3>
#include <Misc.au3>
Opt("MustDeclareVars", 1)
Opt("GUIOnEventMode", 1)
Const $main_gui_width = 860
Const $main_gui_height = 710
Const $child_gui_width = 860
Const $child_gui_height = 660
Const $btn_bkcol = 0xd4d0c8
Const $btn_col = 0x000000
Const $btn_bkcol_a = 0x0a246a
Const $btn_col_a = 0xffffff
Global $dll = DllOpen("user32.dll")
Global $btn_child[6]
Global $btn_shown = 1
Global $strg_t = 0
Global $title = "Demo für Child-Fenster"
Global $dummy = GUICtrlCreateLabel("", 0, 0, 1, 1)
Global $main_gui = GUICreate($title, $main_gui_width, $main_gui_height, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
Global $child1_gui, $child2_gui, $child3_gui, $child4_gui, $child5_gui, $child_akt, $child_old
$btn_child[1] = GUICtrlCreateButton("Button 1", 10, 0, 160, 30)
GUICtrlSetFont(-1, 10, 300)
GUICtrlSetOnEvent(-1, "child_show")
$btn_child[2] = GUICtrlCreateButton("Button 2", 180, 0, 160, 30)
GUICtrlSetFont(-1, 10, 300)
GUICtrlSetOnEvent(-1, "child_show")
GUICtrlSetState(-1, $GUI_HIDE)
$btn_child[3] = GUICtrlCreateButton("Button 3", 350, 0, 160, 30)
GUICtrlSetFont(-1, 10, 300)
GUICtrlSetOnEvent(-1, "child_show")
GUICtrlSetState(-1, $GUI_HIDE)
$btn_child[4] = GUICtrlCreateButton("Button 4", 520, 0, 160, 30)
GUICtrlSetFont(-1, 10, 300)
GUICtrlSetOnEvent(-1, "child_show")
GUICtrlSetState(-1, $GUI_HIDE)
$btn_child[5] = GUICtrlCreateButton("Button 5", 690, 0, 160, 30)
GUICtrlSetFont(-1, 10, 300)
GUICtrlSetOnEvent(-1, "child_show")
GUICtrlSetState(-1, $GUI_HIDE)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
child1_gui()
child2_gui()
child3_gui()
child4_gui()
child5_gui()
$child_akt = $child1_gui ; um letzten aktiven Button wieder neutral zu färben
GUICtrlSetBkColor($btn_child[1], $btn_bkcol_a)
GUICtrlSetColor($btn_child[1], $btn_col_a)
GUICtrlSetState($dummy, $GUI_FOCUS)
GUISetState(@SW_SHOW, $main_gui)
GUISetState(@SW_SHOW, $child1_gui)
While 1
If _IsPressed("11", $dll) And _IsPressed("54", $dll) Then
show_btn()
EndIf
Sleep(1)
WEnd
Func show_btn()
If $btn_shown = 5 Then Return
GUICtrlSetState($btn_child[$btn_shown + 1], $GUI_Show)
$btn_shown += 1
$strg_t = 0
Sleep(500)
EndFunc ;==>show_btn
Func child_show()
$child_old = $child_akt
Switch @GUI_CtrlId
Case $btn_child[1]
If $child_akt <> $child1_gui Then
GUISetState(@SW_HIDE, $child_akt)
GUISetState(@SW_SHOW, $child1_gui)
$child_akt = $child1_gui
GUICtrlSetBkColor($btn_child[1], $btn_bkcol_a)
GUICtrlSetColor($btn_child[1], $btn_col_a)
GUICtrlSetState($dummy, $GUI_FOCUS)
EndIf
Case $btn_child[2]
If $child_akt <> $child2_gui Then
GUISetState(@SW_HIDE, $child_akt)
GUISetState(@SW_SHOW, $child2_gui)
$child_akt = $child2_gui
GUICtrlSetBkColor($btn_child[2], $btn_bkcol_a)
GUICtrlSetColor($btn_child[2], $btn_col_a)
GUICtrlSetState($dummy, $GUI_FOCUS)
EndIf
Case $btn_child[3]
If $child_akt <> $child3_gui Then
GUISetState(@SW_HIDE, $child_akt)
GUISetState(@SW_SHOW, $child3_gui)
$child_akt = $child3_gui
GUICtrlSetBkColor($btn_child[3], $btn_bkcol_a)
GUICtrlSetColor($btn_child[3], $btn_col_a)
GUICtrlSetState($dummy, $GUI_FOCUS)
EndIf
Case $btn_child[4]
If $child_akt <> $child4_gui Then
GUISetState(@SW_HIDE, $child_akt)
GUISetState(@SW_SHOW, $child4_gui)
$child_akt = $child4_gui
GUICtrlSetBkColor($btn_child[4], $btn_bkcol_a)
GUICtrlSetColor($btn_child[4], $btn_col_a)
GUICtrlSetState($dummy, $GUI_FOCUS)
EndIf
Case $btn_child[5]
If $child_akt <> $child5_gui Then
GUISetState(@SW_HIDE, $child_akt)
GUISetState(@SW_SHOW, $child5_gui)
$child_akt = $child5_gui
GUICtrlSetBkColor($btn_child[5], $btn_bkcol_a)
GUICtrlSetColor($btn_child[5], $btn_col_a)
GUICtrlSetState($dummy, $GUI_FOCUS)
EndIf
EndSwitch
If $child_old <> $child_akt Then
Switch $child_old
Case $child1_gui
GUICtrlSetBkColor($btn_child[1], $btn_bkcol)
GUICtrlSetColor($btn_child[1], $btn_col)
Case $child2_gui
GUICtrlSetBkColor($btn_child[2], $btn_bkcol)
GUICtrlSetColor($btn_child[2], $btn_col)
Case $child3_gui
GUICtrlSetBkColor($btn_child[3], $btn_bkcol)
GUICtrlSetColor($btn_child[3], $btn_col)
Case $child4_gui
GUICtrlSetBkColor($btn_child[4], $btn_bkcol)
GUICtrlSetColor($btn_child[4], $btn_col)
Case $child5_gui
GUICtrlSetBkColor($btn_child[5], $btn_bkcol)
GUICtrlSetColor($btn_child[5], $btn_col)
EndSwitch
EndIf
EndFunc ;==>child_show
Func child1_gui()
$child1_gui = GUICreate("", $child_gui_width, $child_gui_height, 0, 10, BitOR($WS_CHILD, $WS_TABSTOP), $WS_EX_CONTROLPARENT, $main_gui)
GUICtrlCreateLabel("Dies ist Seite 1", 50, 200, 200, 30)
GUICtrlSetFont(-1, 12, 600)
GUISetState(@SW_HIDE, $child1_gui)
EndFunc ;==>child1_gui
Func child2_gui()
$child2_gui = GUICreate("", $child_gui_width, $child_gui_height, 0, 10, BitOR($WS_CHILD, $WS_TABSTOP), $WS_EX_CONTROLPARENT, $main_gui)
GUICtrlCreateLabel("Dies ist Seite 2", 50, 200, 200, 30)
GUICtrlSetFont(-1, 12, 600)
GUISetState(@SW_HIDE, $child2_gui)
EndFunc ;==>child2_gui
Func child3_gui()
$child3_gui = GUICreate("", $child_gui_width, $child_gui_height, 0, 10, BitOR($WS_CHILD, $WS_TABSTOP), $WS_EX_CONTROLPARENT, $main_gui)
GUICtrlCreateLabel("Dies ist Seite 3", 50, 200, 200, 30)
GUICtrlSetFont(-1, 12, 600)
GUISetState(@SW_HIDE, $child3_gui)
EndFunc ;==>child3_gui
Func child4_gui()
$child4_gui = GUICreate("", $child_gui_width, $child_gui_height, 0, 10, BitOR($WS_CHILD, $WS_TABSTOP), $WS_EX_CONTROLPARENT, $main_gui)
GUICtrlCreateLabel("Dies ist Seite 4", 50, 200, 200, 30)
GUICtrlSetFont(-1, 12, 600)
GUISetState(@SW_HIDE, $child4_gui)
EndFunc ;==>child4_gui
Func child5_gui()
$child5_gui = GUICreate("", $child_gui_width, $child_gui_height, 0, 10, BitOR($WS_CHILD, $WS_TABSTOP), $WS_EX_CONTROLPARENT, $main_gui)
GUICtrlCreateLabel("Dies ist Seite 5", 50, 200, 200, 30)
GUICtrlSetFont(-1, 12, 600)
GUISetState(@SW_HIDE, $child5_gui)
EndFunc ;==>child5_gui
Func CLOSEClicked()
Exit 0
EndFunc ;==>CLOSEClicked