Jump to content

tabitem and listview problem


Aceguy
 Share

Recommended Posts

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

#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
Link to comment
Share on other sites

  • Moderators

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(""). :idiot:

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

AceGuy,

fast response

Just happened to be passing by..... :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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