Jump to content
Sign in to follow this  

Need some dynamic TreeView help

Recommended Posts


Hi all I need little help with TreeView I have made dynamic listview, now I have problem with button click, If i click on button(this button must show selected TreeViewel ement in msgbox()), program closes itself. and i get error

Z:\dff\desktop-5-12-2008\Edit.au3(227,46) : WARNING: $treeview: possibly used before declaration.
                $item = GUICtrlRead($treeview)

Here is my func that creates or destroys TreeView

Func _CreateListviewItemsFromFile ($destroy)
    $generalitem = GUICtrlCreateTreeViewItem("General", $treeview)
        $flines = _FileCountLines("C:file.txt")
    $cl = 1
    For $i = 1 to $flines
        $cl = $cl + 1
        $dynamic = GUICtrlCreateTreeViewItem(FileReadLine("C:file.txt",$cl),$generalitem)
    $Button1 = GUICtrlCreateButton("&Open File", 8, 260, 70, 20)
    GUICtrlSetState($generalitem, BitOR($GUI_EXPAND, $GUI_DEFBUTTON))
    If $destroy = 0 Then
EndFuncoÝ÷ Ù8Z¶Ëa{²"ë¶éb²Ûâ{.±æî¶Ú'¶+y«^¢·^ë^+-¾'°jëh×6Case $Button0
_CreateListviewItemsFromFile (1);IF value is 0 Func wont create treeview

So I have Gui with buttons, 1 button can Create or destroy treeview. And an other button tells me which element I have picked from Treeviw.

So called "other" button causes me a problem" , how I could fix that other button?

other button gets me that error when I click on it.


Post if you have questions

Edited by au3scr

Share this post

Link to post
Share on other sites


Make a small and working example to duplicate the problem.

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.