Jump to content
Sign in to follow this  

GUI Creation with Tabs

Recommended Posts


I have this problem. I've created GUI with 2 Tabs. In each tab i have diffrent gui labels, code boxes etc. I close Tab sections. Then somewhere below in the code i remove "label" or any other gui from Tab1 and want to create something else in it's place. Problem is when i use simple creation of gui i get this visible in both Tabs. Is it possible to somehow tell code to create the new gui into Tab 1?

$gui_tab[0] = GUICtrlCreateTab(5, 5, 524, 503)
$gui_tab[1] = GUICtrlCreateTabItem("Disk Imaging")
... some guis
$gui_tab[1] = GUICtrlCreateTabItem("Disk Wipe")
... some other guis
GUICtrlCreateTabItem("")   ; end tabitem definition

GuiCtrlDel ... from gui_tab[1]
GuiCtrlCreate in gui_tab[1]

My little company: Evotec (PL version: Evotec)

Share this post

Link to post
Share on other sites

Use GUISwitch($hWin,$tabitem)


#include <GUIConstants.au3>

$gui=GUICreate("", 340, 237, 188, 144)
$Tab1 = GUICtrlCreateTab(16, 8, 305, 225)
$TabSheet1 = GUICtrlCreateTabItem("Tab 1")
GUICtrlCreateLabel("Label 1", 112, 104, 39, 17)
$TabSheet2 = GUICtrlCreateTabItem("Tab 2")
GUICtrlCreateLabel("Label 2", 112, 104, 39, 17)
$butt=GUICtrlCreateButton("Button", 112,150, 39, 17)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        case $butt
            GUICtrlCreateLabel("Label 3", 112, 125, 39, 17)

Notice that I created the button after closing the tabitem creation with GUICtrlCreateTabItem("") which will make the button show in all the tabs. Pressing the button will create a label 3 in Tab 2.

Edited by Nahuel

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  

  • Create New...