INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Need scrollbar handle (get and set) for Treeview control

Need scrollbar handle (get and set) for Treeview control

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close