Highlighting treeview node

S

swas

Hi,
I am trying to master the infamous treeview control (6.0).

I can load with data ok, and have a couple of command buttons to expand /
collapse all nodes. This is working ok. At the completion of the sub I set
MainTree.SelectedItem.EnsureVisible to make sure the current node is
displayed, which works ok. But it is not highlighted as when a node is
clicked by the mouse, so even though it is in view, you don't know which is
the current.

Using MainTree.DropHighlight = MainTree.SelectedItem works fine but then
doesn't allow other nodes to be highlighted (The highlight briefly goes to
the new node when clicked then jumps back to the one previously set by
drophighlight). I don't want to have to start setting the drophighlight for
every mouse click, just restore the treeview to normal mouse function.
MainTree.DropHighlight = nothing removes the highlight

A quick second question - to do custom sorts (Not alpabetically) is this
best achieved by reloading the entire treeview in the order desired, with
sorted = false?

Thanks in advance.

swas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top