Jump to content
Sign in to follow this  
sshrum

Is this possible - dynamic treeviewitem add

Recommended Posts

From where I'm looking at this, it seems like it wouldn't be possible but then again I have been wrong on occassion. :">

Would it be possible to create dynamicaly create treeviewitems? The problem is defining the treeviewitem variable (that I can see).

If someone has a snippet, it would do nicely.

TIA


Sean Shrum :: http://www.shrum.net

All my published AU3-based apps and utilities

'Make it idiot-proof, and someone will make a better idiot'

 

Share this post


Link to post
Share on other sites

Use a For/Next-loop together with Assign() to create the items,

and use a For/Next-loop together with Eval() to read the items.

For $i = 1 To 10
    Assign("item" & $i,GUICtrlCreateListViewItem("Item " & $i,$listview))
Next

Share this post


Link to post
Share on other sites

Kewl...I've implemented the code but for some reason the treeview is not updating.

Is there a refresh command?

case $msg = $button_add
        $path_string = FileSelectFolder("Choose a folder to monitor.", "")
        $path_array = StringSplit($path_string, "\")
        $parent = ""
        For $i = 1 To $path_array[0]
            $parent = $parent & $path_array[$i]
            $parent = StringReplace($parent,":","")
            msgbox(0,"result",$parent)
            if $i = 1 then 
                assign($parent,GUICtrlCreateListViewItem($path_array[$i] & ":",$treeview))              
            Else
                assign($parent,GUICtrlCreateListViewItem($path_array[$i],$parent))          
            EndIf
        Next
Edited by sshrum

Sean Shrum :: http://www.shrum.net

All my published AU3-based apps and utilities

'Make it idiot-proof, and someone will make a better idiot'

 

Share this post


Link to post
Share on other sites

This might solve your problem..

; The first doesn't work, but the two others do.

GUICtrlCreateListView("",10,10,280,80); No text..
GUICtrlCreateListView(" ",10,10,280,80)
GUICtrlCreateListView("|",10,10,280,80)

Pure guessing.

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...