Sign in to follow this  
Followers 0
AF2006

Tab within a tab

2 posts in this topic

Is there a way to get a tab control to appear within another tab control??? I'm not having much luck. It seems to just

want to add the new tab items of the desired embedded tab to the original tab.

Share this post


Link to post
Share on other sites



Is there a way to get a tab control to appear within another tab control??? I'm not having much luck. It seems to just

want to add the new tab items of the desired embedded tab to the original tab.

I think so far the best way that I've found is to make child gui(s), place the tab on the gui(s) you wan them on then if the main tab item for that one is selected then show it i.e.

#include <GUIConstants.au3>

$Main_Gui = GUICreate("My GUI Tab", 500, 500)  ; will create a dialog box that when displayed is centered
$Child_Gui = GUICreate("Child Gui", 480, 460, 15, 35, BitOR($WS_CHILD, $WS_TABSTOP), -1, $Main_Gui)

$child_tab = GUICtrlCreateTab(10, 10, 470, 450)
$c_tab0 = GUICtrlCreateTabItem("c_tab0")
$button = GUICtrlCreateButton("test button", 20, 40, 120, 25)
$c_tab1 = GUICtrlCreateTabItem("c_tab1")
GUICtrlCreateTabItem("")   ; end tabitem definition

GUISwitch($Main_Gui)

GUISetBkColor(0x00E0FFFF)
GUISetFont(9, 300)

$tab = GUICtrlCreateTab(10, 10, 490, 490)

$tab0 = GUICtrlCreateTabItem("tab0")
GUICtrlCreateLabel("label0", 30, 80, 50, 20)
$tab0OK = GUICtrlCreateButton("OK0", 20, 50, 50, 20)
$tab0input = GUICtrlCreateInput("default", 80, 50, 70, 20)

$tab1 = GUICtrlCreateTabItem("tab----1")
GUICtrlCreateLabel("label1", 30, 80, 50, 20)
$tab1combo = GUICtrlCreateCombo("", 20, 50, 60, 120)
GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon") ; default Jon
$tab1OK = GUICtrlCreateButton("OK1", 80, 50, 50, 20)

$tab2 = GUICtrlCreateTabItem("tab2")
GUICtrlSetState(-1, $GUI_SHOW)   ; will be display first
GUICtrlCreateLabel("label2", 30, 80, 50, 20)
$tab2OK = GUICtrlCreateButton("OK2", 140, 50, 50)

$tab3 = GUICtrlCreateTabItem("tab3")

GUICtrlCreateTabItem("")   ; end tabitem definition


GUISetState()

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $tab
            If GUICtrlRead($tab) = 3 Then
                GUISetState(@SW_SHOW, $Child_Gui)
            Else
                GUISetState(@SW_HIDE, $Child_Gui)
            EndIf
    EndSelect
    
WEnd

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0