Jump to content

Select TreeView Item with Code


zeevid
 Share

Recommended Posts

I have a program that loads a treeview with data from a database.

As the data is loaded, the parent items are expanded.

Once all of the items have been loaded into the treeview I want to use code to automatically select the first item under the first parent in the treeview.

Can this be done?

Link to comment
Share on other sites

Look up _GUICtrlTreeViewSetState() in the helpfile. It should be useful for what you asked.

Edited by SolidSnake
HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Link to comment
Share on other sites

Look up _GUICtrlTreeViewSetState() in the helpfile. It should be useful for what you asked.

Thank you for the suggestion and you are right, the _GUICtrlTreeViewSetState() does allow me to select an item in the treeview.

My next question is, how do I find the first item in the view? Since the tree is loaded from a database based on the user currently logged on, I do not know what the text of the item will be. I need some way to identify the first item in the tree. Can this be done?

Thank you.

Link to comment
Share on other sites

My next question is, how do I find the first item in the view? Since the tree is loaded from a database based on the user currently logged on, I do not know what the text of the item will be. I need some way to identify the first item in the tree. Can this be done?

Thank you.

Look at my little treeview example and search at this forum ...

Link to comment
Share on other sites

:lmao:

Works like a charm. Thanks!

How did you get it to work?

I get an error because GuiTreeView.au3 does not contain the function _TreeViewGetItemText().

I was using 3.2.1.5 and have updated to 3.2.1.7 but same problem.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...