>>procedure NodeClick(Node) >>Node.Selected=.t. >>>
>* Select the first item >ThisForm.oTree.Nodes(3).Selected=.T. > >ThisForm.oTree.Left=35 > >* Put the focus in the tree control >ThisForm.oTree.SetFocus() > >* Force a refresh >ThisForm.ShowInfo(ThisForm.oTree.Nodes(3).Key,3) >>
*If we can assume everytime a node is clicked, the ShowInfo method *fires, then it could be imbedded in the NodeClick event. * Node click event in treeview procedure NodeClick(node) if this.tag#node.key &&prevents double firing for same node this.tag=node.key node.selected=.t. ThisForm.ShowInfo(Node.Key,3) else endif endproc * Then, when it's needed to fire for Nodes(3), make the call this way: thisform.oTree.NodeClick(ThisForm.oTree.Nodes(3))