Jump to content

Nested Tabs


 Share

Recommended Posts

kinda bugged me that tab items only returned a ControlId, so adding a Child window to a tabitem wasn't working like i wanted...

So I realized that I could add a child window(with its own Tab control) to an existing control inside the tabitem.... a bit of a workaround but it works :)

#include <Guiconstants.au3>
#include <ANYGUIv2.6.au3>
#region Level 1
$GUI = GUICreate("Nested Tabs", 600, 400)
$tab = GUICtrlCreateTab(0, 22, 600, 400)
$1 = GUICtrlCreateTabItem("1")
$2 = GUICtrlCreateTabItem("2")
$3 = GUICtrlCreateTabItem("3")
$child = GUICtrlCreateLabel( "Nested Tabs", 0, 45, 600, 400); this is inside tab 3
$4 = GUICtrlCreateTabItem("4")
$5 = GUICtrlCreateTabItem("5")
GUISetState()
#endregion
#region Level 2
$target = _GuiTarget ($GUI, "", "", $child); get hwnd to label in tab 3
$tab2 = _TargetaddTab (0, 0, 600, 400, -1, -1, $target); embed tab child window
;over top of Label in Tab 3
$tab2item1 = GUICtrlCreateTabItem("A")
$tab2item2 = GUICtrlCreateTabItem("B")
$tab2item3 = GUICtrlCreateTabItem("C")
$child2 = GUICtrlCreateLabel( "Nested Tabs2", 0, 23, 600, 400); this is inside tab 3, subtab C
GUISetState(); must call again to show $Tab2
#endregion
#region Level 3
$target2 = _GuiTarget ($GUI, "", "", $child2); get hwnd to label in tab 3, subtab C
$tab3 = _TargetaddTab (0, 0, 600, 400, -1, -1, $target2); embed tab child window
;over top of Label in Tab 3, subtab C
$tab3item1 = GUICtrlCreateTabItem("i")
$tab3item1 = GUICtrlCreateTabItem("ii")
$tab3item1 = GUICtrlCreateTabItem("iii")
GUISetState(); must call again to show $Tab3
#endregion
#region Message Loop
While 1
    $msg = GUIGetMsg(1)
    If $msg[0] = $GUI_EVENT_CLOSE Then Exit
WEnd
#endregion

EDIT: added an extra level for demo purposes....

Edited by quaizywabbit
[u]Do more with pre-existing apps![/u]ANYGUIv2.8
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...