Jump to content

Multiple Tab Creation


lab
 Share

Recommended Posts

Hello all,

I'm trying to create multiple Tab Controls using GUICtrlCreateTab. Creating just ONE tab and its items seems no problem, however creating a SECOND tab and its items becomes more complicated. In fact the second tab won't be shown and all items that I wanted to appear in the sceond tab, are shown in the first one.

Is there a command I forgot to specify?

To illustrate see modified example taken from HelpFile:

#include <GUIConstants.au3>

GUICreate("My GUI Tab") ; will create a dialog box that when displayed is centered

GUISetBkColor(0x00E0FFFF)

GUISetFont(9, 300)

;#FIRST TAB CONTROL

$tab=GUICtrlCreateTab (10,10, 200,100)

$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,40)

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)

GUICtrlCreateTabitem ("") ; end tabitem definition

GUICtrlCreateLabel ("label3", 20,130,50,20)

GUISetState ()

;#SECOND TAB CONTROL

;----------------------------------------------------

;(Problem: All items appear in first Tab Control....)

;----------------------------------------------------

$secondtab=GUICtrlCreateTab (10,210, 200,100)

$secondtab0=GUICtrlCreateTabitem ("tab0")

GUICtrlCreateLabel ("label0", 30,280,50,20)

$secondtab0OK=GUICtrlCreateButton ("OK0", 20,250,50,20)

$secondtab0input=GUICtrlCreateInput ("default", 80,250,70,20)

$secondtab1=GUICtrlCreateTabitem ( "tab----1")

GUICtrlCreateLabel ("label1", 30,280,50,20)

$secondtab1combo=GUICtrlCreateCombo ("", 20,250,60,40)

GUICtrlSetData(-1,"Trids|CyberSlug|Larry|Jon|Tylo", "Jon") ; default Jon

$secondtab1OK=GUICtrlCreateButton ("OK1", 80,250,50,20)

$secondtab2=GUICtrlCreateTabitem ("tab2")

GUICtrlSetState(-1,$GUI_SHOW) ; will be display first

GUICtrlCreateLabel ("label2", 30,280,50,20)

$secondtab2OK=GUICtrlCreateButton ("OK2", 140,50,50)

GUICtrlCreateTabitem ("") ; end tabitem definition

GUICtrlCreateLabel ("label3", 20,330,50,20)

GUISetState ()

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Wend

Thanks in advance.....

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...