HansH Posted September 9, 2005 Share Posted September 9, 2005 I am trying to update a treeviewitem, is it possible ? Something like : #include <GUIConstants.au3> $gui = GuiCreate("treeviewtest", 450, 488, 490,360) $tree = GUICtrlCreateTreeView(10, 60, 300, 360,-1 , $WS_EX_CLIENTEDGE) $item = GUICtrlCreateTreeViewItem("original text", $tree) $bt_test = GUICtrlCreateButton("test", 330,60,60,20) GUISetState () while 1 $msg = GUIGetMsg() if $msg = $GUI_EVENT_CLOSE Then ExitLoop if $msg = $bt_test Then GUICtrlSetData("new text", $item) GUICtrlSetState($item,$GUI_SHOW) EndIf WEnd Exit But the treeitem keeps his old text, any ideas ? Link to comment Share on other sites More sharing options...
Dickb Posted September 9, 2005 Share Posted September 9, 2005 I am trying to update a treeviewitem, is it possible ?<{POST_SNAPBACK}>First you had the "GUICtrlSetData" wrong. (See code below and help file).Second, I could only get it working with the beta. (I'm using the latest)Will this help you on your way?#include <GUIConstants.au3> $gui = GuiCreate("treeviewtest", 450, 488, 490,360) $tree = GUICtrlCreateTreeView(10, 60, 300, 360,-1 , $WS_EX_CLIENTEDGE) $item = GUICtrlCreateTreeViewItem("original text", $tree) $bt_test = GUICtrlCreateButton("test", 330,60,60,20) GUISetState () while 1 $msg = GUIGetMsg() if $msg = $GUI_EVENT_CLOSE Then ExitLoop if $msg = $bt_test Then GUICtrlSetData($item, "new text") GUICtrlSetState($item,$GUI_SHOW) EndIf WEnd Exit Link to comment Share on other sites More sharing options...
HansH Posted September 10, 2005 Author Share Posted September 10, 2005 First you had the "GUICtrlSetData" wrong. (See code below and help file).Second, I could only get it working with the beta. (I'm using the latest)Will this help you on your way?#include <GUIConstants.au3> $gui = GuiCreate("treeviewtest", 450, 488, 490,360) $tree = GUICtrlCreateTreeView(10, 60, 300, 360,-1 , $WS_EX_CLIENTEDGE) $item = GUICtrlCreateTreeViewItem("original text", $tree) $bt_test = GUICtrlCreateButton("test", 330,60,60,20) GUISetState () while 1 $msg = GUIGetMsg() if $msg = $GUI_EVENT_CLOSE Then ExitLoop if $msg = $bt_test Then GUICtrlSetData($item, "new text") GUICtrlSetState($item,$GUI_SHOW) EndIf WEnd Exit<{POST_SNAPBACK}>That's stupid of me, thx i am using the latest beta so that's okHans Link to comment Share on other sites More sharing options...
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