Sign in to follow this  
Followers 0
Rodger

Tab In ChildTab

3 posts in this topic

#1 ·  Posted (edited)

#include <GuiTab.au3>
#include <GuiEdit.au3>
#include <GuiTreeView.au3>
#include <GuiListView.au3>
#include <GuiButton.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <Array.au3>

Global $main_GUI,$ok_button,$cancel_button

; This window has 2 ok/cancel-buttons
$main_GUI        = GUICreate("TAB in TAB",260,250,-1,-1)
$ok_button        = GUICtrlCreateButton("OK",40,220,70,20)
$cancel_button    = GUICtrlCreateButton("Cancel",150,220,70,20)

; Create the first child window that is implemented into the main GUI
$child1            = GUICreate("",230,170,15,35,BitOr($WS_CHILD,$WS_TABSTOP),-1,$main_GUI)
$child_tab        = GUICtrlCreateTab(10,10,210,150)
$child11tab        = GUICtrlCreateTabItem("1")
$child12tab        = GUICtrlCreateTabItem("2")
GUICtrlCreateTabItem("")

GUISetState()

; Create the second child window that is implemented into the main GUI
$child2            = GUICreate("",230,170,15,35,BitOr($WS_CHILD,$WS_TABSTOP),-1,$main_GUI)
$listview2        = GUICtrlCreateListView("Col1|Col2",10,10,210,150,-1,$WS_EX_CLIENTEDGE)
GUICtrlCreateListViewItem("ItemLong1|ItemLong12", $listview2)
GUICtrlCreateListViewItem("ItemLong2|Item22", $listview2)

; Switch back the main GUI and create the tabs
GUISwitch($main_GUI)
$main_tab        = GUICtrlCreateTab(10,10,240,200)
$child1tab        = GUICtrlCreateTabItem("Child1")
$child2tab        = GUICtrlCreateTabItem("Child2")
GUICtrlCreateTabItem("")

GUISetState()

While 1
    $msg = GUIGetMsg(1)
    Switch $msg[0]
        Case $GUI_EVENT_CLOSE, $cancel_button
            ExitLoop

        Case $main_tab
            Switch GUICtrlRead($main_tab)
                Case 0
                  GUISetState(@SW_HIDE,$child2)
                  GUISetState(@SW_SHOW,$child1)

                Case 1
                 GUISetState(@SW_HIDE,$child1)
                  GUISetState(@SW_SHOW,$child2)
          EndSwitch


       Case $child_tab
            Switch GUICtrlRead($child_tab)
                Case 0
                    ConsoleWrite("0" & @CRLF)

                Case 1
                 ConsoleWrite("1" & @CRLF)
          EndSwitch

    EndSwitch
WEnd

Hello,

I found the above example of a Tab in a Tab. I like to know if there is an easy way to get another tab in the child_tab; so first you have

tab "Child1" | "Child2"

then tab "1" | tab "2" under tab "Child1"

then eg. tab "11" | tab "22" under tab "1"

I tried to make tab "1" as some kind of a parent tab but I didn't succeed. Is there an easy way to accomplish this?

Thnx,

Rodger

Edited by Rodger

Share this post


Link to post
Share on other sites



Rodger,

Is there an easy way to accomplish this?

I am afraid not - one tab control per GUI, so using child windows is the only way to go if you want multiple tabs. :x

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi,

maybe using "TCS_Multiline" gives you already what you want.

HTH, Reinhard

Edited by ReFran

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