Synapse Posted April 12, 2008 Share Posted April 12, 2008 Hi is there a simple way to get the tree items (or subitems) text or id when i click it... Thank you Link to comment Share on other sites More sharing options...
smashly Posted April 12, 2008 Share Posted April 12, 2008 Hi, General question.. then the general answer is yes. There's a few contributing factors as to which way to do it eg: are you using on event mode or not, using internal or external listview items etc... Post a working sample of your code if your wanting further info on what is the easiest way to get the id/text of the listview item clicked. Cheers Link to comment Share on other sites More sharing options...
Zedna Posted April 12, 2008 Share Posted April 12, 2008 For treeview manipulation internal/external look at: ControlTreeView() _GUICtrlTreeView_xxx() UDF functions Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
rasim Posted April 12, 2008 Share Posted April 12, 2008 Hi is there a simple way to get the tree items (or subitems) text or id when i click it... Thank youTry this: expandcollapse popup#include <GuiConstants.au3> Opt("GuiOnEventMode", 1) $hGUI = GUICreate("Test GUI", 300, 200) GUICreate("My GUI with treeview", 350, 215) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $treeview = GUICtrlCreateTreeView(6, 6, 100, 150, BitOr($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) $DummyStart = GUICtrlCreateDummy() $generalitem = GUICtrlCreateTreeViewitem("General", $treeview) $aboutitem = GUICtrlCreateTreeViewitem("About", $generalitem) $compitem = GUICtrlCreateTreeViewitem("Computer", $generalitem) $useritem = GUICtrlCreateTreeViewitem("User", $generalitem) $displayitem = GUICtrlCreateTreeViewitem("Display", $treeview) $resitem = GUICtrlCreateTreeViewitem("Resolution", $displayitem) $otheritem = GUICtrlCreateTreeViewitem("Other", $displayitem) $DummyEnd = GUICtrlCreateDummy() GUISetState() For $i = $DummyStart To $DummyEnd GUICtrlSetOnEvent($i, "_GetText") Next While 1 Sleep(100) WEnd Func _Exit() Exit EndFunc Func _GetText() ConsoleWrite(GUICtrlRead(@GUI_CtrlId, 1) & @LF) EndFunc Link to comment Share on other sites More sharing options...
Synapse Posted April 12, 2008 Author Share Posted April 12, 2008 (edited) Thank you all...the example Rasim gave me it`s exactly what i needed...thx again... @smashly no need to be sarcastic...btw..i was talking about a treeView not a listview... Edited April 12, 2008 by Synapse Link to comment Share on other sites More sharing options...
Synapse Posted April 12, 2008 Author Share Posted April 12, 2008 Is there a way avoiding onevent mode? Link to comment Share on other sites More sharing options...
Zedna Posted April 12, 2008 Share Posted April 12, 2008 (edited) Is there a way avoiding onevent mode?Yes. Use Message loop mode. More details/examples in helpfile. Edited April 12, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Synapse Posted April 12, 2008 Author Share Posted April 12, 2008 Yes. Use Message loop mode. More details/examples in helpfile.thx...I asked here in the Help Thread...cuz I allready tryed using the help and didn`t made it...never came out as i wanted.... 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