Jump to content

How to Hide tab Item


 Share

Recommended Posts

Does somone can help to figure out how to hide tab item?

I do not want to delete the tab item but to hide it. I enclose script to start with.

#include <GUIConstants.au3>
#include <GuiTab.au3>
Global $current
$Form1 = GUICreate("AForm1", 460, 260, 193, 115)
$Tab1 = GUICtrlCreateTab(48, 16, 289, 193)
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")
GUICtrlSetState(-1,$GUI_SHOW)
GUICtrlCreateTabItem("")
$Button1 = GUICtrlCreateButton("Hide Active Tab Item", 344, 8, 107, 25, 0)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case  $Button1
            Local $activeTabItem
            $activeTabItem =_FindActiveTabIndex()
            ConsoleWrite("Active Index tab is= " & $activeTabItem & @CRLF)
            _GUICtrlTabDeleteItem ($Tab1, $activeTabItem)
    EndSwitch
WEnd

func _FindActiveTabIndex()
    If ($current <> _GUICtrlTabGetCurFocus ($Tab1)) Then
        $current = _GUICtrlTabGetCurFocus ($Tab1)
    endif
        return $current
EndFunc

Be Green Now or Never (BGNN)!

Link to comment
Share on other sites

I don't know of an easy way to hide a tab item. I see you used Smoke_N's suggestion to delete the tab. It may be best to just delete and recreate the tab item that you need to hide. Maybe you could add the tab item creation into a function and then just delete the tab to hide and and then run the function to recreate it. You could store values from the deleted tab into variables and reassign them to the controls when you recreate.

It's kind of a cumbersome solution but it might get you going.

Link to comment
Share on other sites

Please, I can not belive that Auto it can not have this feature :shocked:

Here is simmilar topic without solution:

http://www.autoitscript.com/forum/index.ph...hl=hide+tabitem

Don't think has anything to do with AutoIt not having this feature.

http://msdn.microsoft.com/library/default....tab/reflist.asp

Hide is not state list for tab controls.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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