Jump to content

GUICtrlCreateTabItem("") Not working?


rcmaehl
 Share

Recommended Posts

Hi all,

I'm experiencing an issue that even though I've closed the tab structure using 

GUICtrlCreateTabItem("")

It's still adding tabs to the previous tab control. Example code is below:

#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Main()

Func Main()

    Local $hGUI = GUICreate("TestGUI", 640, 480, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX))

    GUICtrlCreateTab(0, 0, 280, 300, 0)

    #Region
    GUICtrlCreateTabItem("Tab1")
    #EndRegion

    #Region
    GUICtrlCreateTabItem("Tab2")
    #EndRegion

    #Region
    GUICtrlCreateTabItem("Tab3")
    #EndRegion

    #Region
#cs
    GUICtrlCreateTabItem("Tab4")
#ce
    #EndRegion

    #Region
    GUICtrlCreateTabItem("Tab5")
    #EndRegion

    #Region
    GUICtrlCreateTabItem("Tab6")
    #EndRegion
    GUICtrlCreateTabItem("")

    GUICtrlCreateTab(280, 0, 360, 300)

    #Region
    GUICtrlCreateTabItem("NewTab1")

    #EndRegion

    #Region
    GUICtrlCreateTabItem("NewTab2")

    #EndRegion
    GUICtrlCreateTabItem("")

    GUISetState(@SW_SHOW, $hGUI)

    While 1

        $hMsg = GUIGetMsg()

        Select

            Case $hMsg = $GUI_EVENT_CLOSE
                GUIDelete($hGUI)
                Exit

        EndSelect
    WEnd
EndFunc

Any suggestions on how to resolve would be Appreciated!

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

Quote

A GUI can only hold a single tab control, but it is possible to create child GUIs each holding a tab control.

Oops. Thanks helpfile

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

And ChildGUI's break everything...

#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Main()

Func Main()

    Local $hGUI = GUICreate("TestGUI", 640, 480, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX))

    GUICreate("", 0, 0, 280, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
    GUICtrlCreateTab(0, 0, 280, 300, 0)

    #Region
    GUICtrlCreateTabItem("Tab1")
    #EndRegion

    #Region
    GUICtrlCreateTabItem("Tab2")
    #EndRegion

    #Region
    GUICtrlCreateTabItem("Tab3")
    #EndRegion

    #Region
#cs
    GUICtrlCreateTabItem("Tab4")
#ce
    #EndRegion

    #Region
    GUICtrlCreateTabItem("Tab5")
    #EndRegion

    #Region
    GUICtrlCreateTabItem("Tab6")
    #EndRegion
    GUICtrlCreateTabItem("")
    GUISetState()

    $hQuickTabs = GUICreate("", 280, 0, 360, 300, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
    GUICtrlCreateTab(280, 0, 360, 300)

    #Region
    GUICtrlCreateTabItem("NewTab1")

    #EndRegion

    #Region
    GUICtrlCreateTabItem("NewTab2")

    #EndRegion
    GUICtrlCreateTabItem("")
    GUISetState()
    GUISwitch($hGUI)

    GUISetState(@SW_SHOW, $hGUI)

    While 1

        $hMsg = GUIGetMsg()

        Select

            Case $hMsg = $GUI_EVENT_CLOSE
                GUIDelete($hGUI)
                Exit

        EndSelect
    WEnd
EndFunc

Can anyone tell me what I'm doing wrong?

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

Oops, I forgot that for GUI Creation it's

  • Height, Width, X, Y

compared to making a control which is

  • X, Y, Height Width

So, of course, a GUI with 0 height or 0 width isn't going to show up....

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

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