Jump to content

Unassign a control from a tab item


rcmaehl
 Share

Recommended Posts

How would I go about making it so a control is no longer hidden or visible based on the tab selected, I checked the helpfile but I'm not seeing anything off the bat.

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

Use GuiCtrlRead($idTab) see example below:

#include <GUIConstantsEx.au3>

Example()

Func Example()
    GUICreate("My GUI Tab", 250, 150); will create a dialog box that when displayed is centered

    GUISetBkColor(0x00E0FFFF)
    GUISetFont(9, 300)

    Local $idTab = GUICtrlCreateTab(10, 10, 200, 100)

    GUICtrlCreateTabItem("tab0")
    GUICtrlCreateLabel("label0", 30, 80, 50, 20)
    GUICtrlCreateButton("OK0", 20, 50, 50, 20)
    GUICtrlCreateInput("default", 80, 50, 70, 20)

    GUICtrlCreateTabItem("tab----1")
    GUICtrlCreateLabel("label1", 30, 80, 50, 20)
    GUICtrlCreateCombo("", 20, 50, 60, 120)
    GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon"); default Jon
    GUICtrlCreateButton("OK1", 80, 50, 50, 20)

    GUICtrlCreateTabItem("tab2")
    GUICtrlSetState(-1, $GUI_SHOW); will be display first
    GUICtrlCreateLabel("label2", 30, 80, 50, 20)
    GUICtrlCreateButton("OK2", 140, 50, 50)

    GUICtrlCreateTabItem(""); end tabitem definition

    Local $idLabel = GUICtrlCreateLabel("", 20, 130, 250, 20)
        GUICtrlSetData($idLabel, "Tab" & GUICtrlRead($idTab) + 1 & " Selected")

    GUISetState(@SW_SHOW)

    Local $idMsg
    ; Loop until the user exits.
    While 1
        $idMsg = GUIGetMsg()

        If $idMsg = $GUI_EVENT_CLOSE Then ExitLoop
        If $idMsg = $idTab Then
            ; display the clicked tab
            WinSetTitle("My GUI Tab", "", "My GUI Tab" & GUICtrlRead($idTab))
            GUICtrlSetData($idLabel, "Tab" & GUICtrlRead($idTab) & " Selected")
        EndIf
    WEnd
EndFunc   ;==>Example

 

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