Jump to content

GUICtrlDelete and tabs


SlimShady
 Share

Recommended Posts

  • 2 weeks later...

GUICtrlDelete doesn't work tabs.

It would be nice if you could make it possible.

Currently I'm using GUISendMsg and that works well, but I prefer GUICtrlDelete.

GUISendMsg($MainTabs, $TCM_DELETEITEM, $TabNum, 0)

<{POST_SNAPBACK}>

slim, i've encountered this problem myself. glad you have a solution, but do you have the value for $TCM_DELETEITEM ? (I can't seem to connect to MSDN to search) Thanks
Link to comment
Share on other sites

Did you know they fixed it in the latest unstable?

You can delete a tab by passing the tabitem variable to GUICtrlDelete.

Here's an example that works with the latest unstable:

#include <GUIConstants.au3>
AutoItSetOption("TrayIconDebug", 1)

;Initialize variables
Global $style1
Global $IniFile
Global $GUIWidth
Global $GUIHeight

$GUIWidth = 250
$GUIHeight = 250
$IniFile = StringTrimRight(@ScriptFullPath, 3) & "ini"

GUICreate("New GUI", $GUIWidth, $GUIHeight)

$MainTabs = GUICtrlCreateTab(10, 10, 225, 175)
   $TabItem1 = GUICtrlCreateTabItem("Tab 1")
   $TabItem2 = GUICtrlCreateTabItem("Tab 2")
   $TabItem3 = GUICtrlCreateTabItem("Tab 3")
   $TabItem4 = GUICtrlCreateTabItem("Tab 4")
   $TabItem5 = GUICtrlCreateTabItem("Tab 5")
GUICtrlCreateTabItem("")

$Button_1 = GUICtrlCreateButton("OK", 50, 200, 70, 20)

GUISetState(@SW_SHOW)

While 1
   Sleep(25)
   $msg = GUIGetMsg()
   Select
   
      Case $msg = $GUI_EVENT_CLOSE
         GUIDelete()
         Exit

      Case $msg = $Button_1
         GUICtrlDelete($TabItem5)
         Sleep(1000)
         GUICtrlDelete($TabItem4)
         Sleep(1000)
         GUICtrlDelete($TabItem3)
         Sleep(1000)
         GUICtrlDelete($TabItem2)
         Sleep(1000)
         GUICtrlDelete($TabItem1)

   EndSelect

WEnd
Edited by SlimShady
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...