Sign in to follow this  
Followers 0
name15

how to add item to an other item

7 posts in this topic

how to add item to an other item by using

_GUICtrlTreeView_GetTree()

Share this post


Link to post
Share on other sites



how to add item to an other item by using

_GUICtrlTreeView_GetTree()

How about _GUICtrlTreeView_AddChild() instead? And what made you think _GUICtrlTreeView_GetTree() had anything to do with adding any items anywhere?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

you right

but can add item by his location

not by name as

i0|i1|i2|i3|i4

(i4 a item to add new item)

Share this post


Link to post
Share on other sites

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
#include <GuiTreeView.au3>

Global $i1 = 1, $i2 = 1

$Form2 = GUICreate("Form1", 274, 298, -1, -1)
$TreeView1 = GUICtrlCreateTreeView(0, 0, 185, 297)
$Button1 = GUICtrlCreateButton("add item", 192, 8, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("add child", 192, 40, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            _GUICtrlTreeView_BeginUpdate($TreeView1);begin update
            _GUICtrlTreeView_Add($TreeView1, 0, "Item" & $i1)
            _GUICtrlTreeView_EndUpdate($TreeView1);end update
            $i1 += 1
        Case $Button2
            _GUICtrlTreeView_BeginUpdate($TreeView1);begin update
            _GUICtrlTreeView_AddChild($TreeView1, _GUICtrlTreeView_GetFirstItem($TreeView1), "Child" & $i2)
            $i2 += 1
            _GUICtrlTreeView_EndUpdate($TreeView1);end update
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

thank you

i am trying to make file explorer when user but link in address the tree view will add correct new item to tree with out

selected how can do that

Share this post


Link to post
Share on other sites

any idea

Share this post


Link to post
Share on other sites

thank you

i am trying to make file explorer when user but link in address the tree view will add correct new item to tree with out

selected how can do that

That is not very clear English, but you should explain how close you are to what you want.

Post a short demo script that comes as close as you can to this, and then explain what you want to work differently in that code.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  
Followers 0