Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TreeView Control 1

Status
Not open for further replies.

scking

Programmer
Jan 8, 2001
1,263
US
I'm attempt use of the Microsoft Common Controls 6.0 in Access. There is almost no documentation that I have been able to find. I'm displaying a heirarchy of parts and would like to be able to display the root without being expanded and then expand the entire heirarchy with a button.

Is there a method at the Treeview level to accomplish this without having to iterate through the entire population of Nodes? Intellisense does not prompt with all methods for this control.

Also, I would like to be able to use a NodeClick event but it isn't displayed on the property sheet. I have found code which uses this event but haven't been able to accomplish it myself. I want to display information about the part when I click the node. -------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
I implemented a treeview control. The code is all at work. I was able to find a .chm file describing it on my system; of course that doesn't guarentee you have one.

I was able to find code snippets via a google search that held me in good stead.

IIRC, there were plenty of methods to do just about whatever you want to with the control. However, I don't recall an 'expand all command'. I pretty much let the user manipulate the control as is, without providing much in the way of external navigational controls. I was able to cause the tree control to be opened with a specific node expanded; but it required iterating through all the nodes.

I don't really consider the code I wrote publishable as there is considerable baggage, as the tree control was in fact a view on a set of tables (names, parent-child relationships, and properties).

I don't think there's any significant performance hit in iterating though all the nodes to expand them.

 
I've had some success over the weekend working with treeview but I still have questions. When I drop the treeview ActiveX control on a form and look at what events are available in the property windows it is pretty spare. However, when I follow combo's link to the MSDN ActiveX control documentation it claims significantly more events are available. Currently, I reference the ActiveX control. Do I need to instantiate it to gain access to the available events MSDN claims. I'm particularly interested in using the Click, and NodeClick events.

-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Try right clicking on the control and choosing 'build event'.

Then, in the combo on the right side of the module editor, select the tree control. You can then select events from the right hand side combo.
 
I feel ridiculous about this. 95% of the time I use the builder from the property sheet so I figured all the events would be shown. Lesson learned, thanks beetee!

Steve -------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Don't feel ridiculous, I just kinda stumbled across that feature. I'm not sure if I've ever read about; so I'm glad to pass my good fortune on.

Have fun with the tree control, they're pretty cool.

P.S. you may wind up with trouble registering the thing in a secure environment. I actually wound up writing a C++ program that an admin can run on a remote machine to register the thing. if you need that info in the future, we can pass that on as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top