>>>Hi George,
>>>
>>>>ThisForm.MenuTree.Nodes(NodeKey).Expanded = .T.
>>>
>>>I found the EXPANDED property in the help file. The example show a numeric value for the node.
Nodes(1).expanded = .T. When I said KEY I meant the KEY I gave it when I added it. i.e. ABA01
>>>
>>>How could I now find this numeric value based on the KEY I gave it?
>>
>>One more thing. If you want the programmatically expanded key to be selected, use ThisForm.MenuTree.SelectedItem = ThisFormMenuTree.Nodes(NodeKey).
>
>George,
>There is also a Selected property of the Node itself you could use.
Yep! I don't think, unless I'm missing something, that one would have anything over the other.
>FWIW, in my TreeView class, I have a property called lSelectOnExpandCollapse. If set to .T., when a user expands or collapses a node, the node is also selected. The same code then calls the NodeClick event to make sure any code that is associated with a user selecting a node is executed.
The only time I've played around with programmatically expanding a treeview node was with SpyFoxFox. I'll key this in mind, however. Thanks, Larry.
George
Ubi caritas et amor, deus ibi est