ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Treeview control in an Excel form (https://www.excelbanter.com/excel-programming/299216-treeview-control-excel-form.html)

Theo

Treeview control in an Excel form
 
Can anyone tell me how do you add nodes to a Treeview control, how do you activate its events and retrieve the highlighted node? The properties window doesn't seem to have any Contolsource property or the like. I'm using Microsoft TreeView Control 6.0

Chris

Treeview control in an Excel form
 
You can use the Forms Activate Event to add your node
Me.TreeView1.Nodes.Add.Text = "FirstOne
Me.TreeView1.Nodes.Add.Text = "SecondOne

As far as the events: you should find them in your code window when you select the Treeview's control in the left dropdown box of your code window

chris: Child nodes

Treeview control in an Excel form
 
To add child nodes use the Add method of Nodes.
Me.TreeView1.Nodes.Add , , , "FirstOne
Me.TreeView1.Nodes.Add 1, 4, , "A"

----- chris wrote: ----

You can use the Forms Activate Event to add your node
Me.TreeView1.Nodes.Add.Text = "FirstOne
Me.TreeView1.Nodes.Add.Text = "SecondOne


As far as the events: you should find them in your code window when you select the Treeview's control in the left dropdown box of your code window

Jurry[_14_]

Treeview control in an Excel form
 
For more info on treeview see:
http://www.devx.com/vb/Article/9707/0/page/1

and

http://www.developerfusion.com/show/77/1/

Jurry

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 07:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com