[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1308
  • Last Modified:

Getting the scrollbar ctrl of a CTreeCtrl

Hi,

I'm writing a VC++ 5.0 application. I have a CTreeCtrl that I would like to programmatically scroll. I could not find a way to get the CScrollBar associated with a CTreeCtrl so can
scroll the window. I know that if I use a CTreeView then the GetScrollBarCtrl() function works and returns the CScrollBar object; however I do not have a CTreeview, just a CTreeCtrl.

Thanks,
Ralph.
0
rakhras
Asked:
rakhras
1 Solution
 
galkinCommented:
I Examined tree control with Spy and found that scrollbar of tree control is actually not a window but a frame control( only drawing) so you can't get it handle. To scroll a tree view control use SendMessage(WM_VSCROLL, SB_LINEUP). Replace the second argument if you need to scroll it to another space.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now