
05-23-2003, 12:28 PM
|
 |
Senior Contributor
* Expert *
|
|
Join Date: Apr 2003
Location: Never where I want to be
Posts: 1,272
|
|
Quote: Originally Posted by NeoGioZ Thanks for your reply.
EnsureVisible will not work because all it does is make sure that if the Current Node is a child that it will expand all the necesary parents to ensure that the Current Node is visisble.
Are you sure?
This code works on my PC, in that it adds 100 children to a root, and makes sure child66 is visible in the list. Make the treeview tiny.
Code:
Dim i As Long
TreeView.Nodes.Clear
TreeView1.Nodes.Add , , "Top", "Top"
For i = 1 To 100
TreeView1.Nodes.Add "Top", tvwChild, "Child" & i, "Child" & i
Next
TreeView1.Nodes("Child66").Selected = True
TreeView1.SelectedItem.EnsureVisible
TreeView1.SetFocus
If it really doesn't work for you then what release of the Windows Common Controls are you using? It should have a "(SP?)" after the name of the component.
|
|