Sign in to follow this  
Followers 0
Possessed

Can you make a tab have a scroll bar?

6 posts in this topic

I am making this small application and i need a lot of room in one tab can you put scrollbars in a tab? And you if can how would the code look? If i cant what would be a way were i can put 80+ drop down lists in my GUI? anyways hope someone can help.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I am making this small application and i need a lot of room in one tab can you put scrollbars in a tab? And you if can how would the code look? If i cant what would be a way were i can put 80+ drop down lists in my GUI? anyways hope someone can help.

Below is an example of how to put a tab inside a tab by aec. Using the same idea, create a child window but instead of putting another tab in it put all your controls for that tab in the child window and add a scrollbar to it.

; Example of TAB in TAB ctrl by aec
#include <GUIConstants.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
    EndSwitch
WEnd
Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Thanks for your help this will work great for me.

Share this post


Link to post
Share on other sites

Just for the record.

The TabInTab example quoted by martin above, together with MultiTab example were presented here

Share this post


Link to post
Share on other sites

Just for the record.

The TabInTab example quoted by martin above, together with MultiTab example were presented here

@aec

Was that example written by you? I have it saved as an example by Mega. If I'm wrong my apologies, and I will change my notes.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

@aec

Was that example written by you? I have it saved as an example by Mega. If I'm wrong my apologies, and I will change my notes.

martin,

Indeed, it was written by me. But really, there is no need for apologies. Instead, I appreciate so much all the help you give to the autoit community that I feel the need to thank you.

My best regards

Edited by aec

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