Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need scrollbar handle (get and set) for Treeview control

Status
Not open for further replies.

CodeComa

Programmer
Oct 24, 2016
1
0
0
US
Hi,

I am using MS Access 2010 and am using the active x Treeview control available in the list of active x controls.

The size of the Treeview allows the user to view up to 70 records at a time, with nodes up to 4 deep. So it looks busy to the user.

Now, I am doing a good bit of coding to add, move, and delete new and existing records. Say the user selects a node that is viewable in the very middle of the Treeview. They right click, some forms come up, and eventually they click a button to add to, move, or delete that node.

When the code is done doing its thing, I refresh the tree, and I want the focus to go right back to the node they selected in the Treeview before requesting an add, move or delete, and have it viewable possibly in the exact same location within the Treeview (for example, 3 inches from the top). To reselect the node they clicked on after the refresh, I use a GotoNode (id) function that will find the exact node I want, then I use insurevisible to, of course, make sure that node is visible in the tree.

The problem is that insurevisble invariably makes the tree show that node at the very top of the tree as the first highlighted record, or the very bottom of tree showing it as the last (and highlighted) record, and in essence is scrolling the Treeview up or down.

I need to be able to select a node, use insurevisible, and then programatically scroll the tree to, for example, the very middle.

So, I need a setscroll and a getscroll sort of API routine, but I cannot find one. There are plenty for list boxes and subforms, and in fact I am using them now, but I need to do the same thing with a Treeview.

Any ideas would be greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top