Letraindusoir Posted October 23, 2020 Share Posted October 23, 2020 (edited) expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiTreeView.au3> #include <WindowsConstants.au3> Example() Func Example() Local $hGUI = GUICreate("My GUI Tab", 600, 480) GUISetBkColor(0x00E0FFFF) GUISetFont(9, 300) GUICtrlCreateTab(10, 10, 580, 320) GUICtrlCreateTabItem("tab----0") GUICtrlCreateEdit("", 30, 40, 150,50) GUICtrlCreateTabItem("tab----1") GUICtrlCreateLabel("label1", 30, 40, 50, 20) GUICtrlCreateCombo("", 90, 40, 90, 120) GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo|guinness", "Jon") GUICtrlCreateTabItem("tab----2") Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES) Local $g_hTreeView =_GUICtrlTreeView_Create($hGUI, 30, 40, 396, 268, $iStyle, $WS_EX_CLIENTEDGE) GUICtrlCreateTabItem("") ; end tabitem definition Local $AddData = GUICtrlCreateButton("AddData", 265, 400, 90,30) GUISetState(@SW_SHOW) Local $idMsg While 1 $idMsg = GUIGetMsg() If $idMsg = $GUI_EVENT_CLOSE Then ExitLoop If $idMsg = $AddData Then _GUICtrlTreeView_BeginUpdate($g_hTreeView) For $x = 1 To Random(2, 10, 1) $hItem = _GUICtrlTreeView_Add($g_hTreeView, 0, StringFormat("[%02d] New Item", $x)) For $y = 1 To Random(2, 10, 1) _GUICtrlTreeView_AddChild($g_hTreeView, $hItem, StringFormat("[%02d] New Child", $y)) Next Next _GUICtrlTreeView_EndUpdate($g_hTreeView) EndIf WEnd EndFunc ;==>Example As shown above, why does it not work correctly? Edited October 23, 2020 by Letraindusoir Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 23, 2020 Moderators Share Posted October 23, 2020 (edited) Letraindusoir, I presume you are asking about why the TreeView appears on all tabs. I suggest reading the Tabs tutorial in the Wiki - you need to look after the hide/show of UDF-created controls yourself. M23 Edited October 23, 2020 by Melba23 Typo Letraindusoir 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Letraindusoir Posted October 29, 2020 Author Share Posted October 29, 2020 Quote the UDF created controls appear on every tab. Remember this is because they are not part of the internal AutoIt control management structure, so AutoIt does not know how to handle them. It is up to you to manage them by seeing which tab is active and hiding/showing these controls as required I got it.Thanks for the help! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now