Aceguy Posted February 10, 2011 Posted February 10, 2011 Hi guy, been having this problem... i want to create tab items on the contents of a folder (tab item names) then read the txt file contents and put it onto a listview.... When i click a update button, would like to destroy the listviews.. and the tabs, and repopulate.... However, upon RE-creating the listview, it doesnt appear, see code... please help.. expandcollapse popup#include <GUIConstantsEx.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include<guitab.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Form1", 625, 443, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize") GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore") $button = GUICtrlCreateButton("go", 5, 5, 75, 20) GUICtrlSetOnEvent(-1, "go") $Tab1 = GUICtrlCreateTab(64, 32, 521, 377) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) Dim $list[11] For $x = 1 To 10 GUICtrlCreateTabItem($x) $list[$x] = GUICtrlCreateListView("list x", 70, 70, 500, 300) For $d = 1 To 10 GUICtrlCreateListViewItem($x * 10 + $d, $list[$x]) Next Next GUICtrlCreateTabItem("") GUICtrlSetOnEvent(-1, "Tab1Change") GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func go() For $t = 1 To _GUICtrlTab_GetItemCount($Tab1) GUICtrlDelete($list[$t]) Next _GUICtrlTab_DeleteAllItems($Tab1) Dim $list[6] For $x = 1 To 5 GUICtrlCreateTabItem($x) $list[$x] = GUICtrlCreateListView("list x", 70, 70, 500, 300) For $d = 1 To 10 GUICtrlCreateListViewItem($x * 10 + $d, $list[$x]) Next Next EndFunc ;==>go Func Form1Close() Exit EndFunc ;==>Form1Close Func Form1Maximize() EndFunc ;==>Form1Maximize Func Form1Minimize() EndFunc ;==>Form1Minimize Func Form1Restore() EndFunc ;==>Form1Restore Func Tab1Change() EndFunc ;==>Tab1Change [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
Moderators Melba23 Posted February 10, 2011 Moderators Posted February 10, 2011 Aceguy,Just delete the whole tab and recreate it: Func go() GUICtrlDelete($Tab1) $Tab1 = GUICtrlCreateTab(64, 32, 521, 377) Dim $list[6]But do not forget to close the new tab item definiton with GUICtrlCreateTabItem(""). I checked and all the controls on the tab are destroyed when the tab itself is destroyed - unlike when you use the _GUICtrlTab_DeleteItem command. M23 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
Aceguy Posted February 10, 2011 Author Posted February 10, 2011 Great, thanks vm. fast response too [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock
Moderators Melba23 Posted February 10, 2011 Moderators Posted February 10, 2011 AceGuy,fast responseJust happened to be passing by..... M23 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
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