Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

URGENT: TTreeView: when dragging a treenode the tree control does not scroll vertically

If I have a long list of nodes in the tree, and the user selects the bottom node, and the root node is not displayed in the tree control (say the top 10 nodes are not displayed because they can't fit on the screen), the user drags the node up attempting to drop on the root but the treeview control does not scroll upwards so the user can get to the root.

PLEASE HELP ME!!!
0
gretzky_owns_u
Asked:
gretzky_owns_u
1 Solution
 
Stuart_JohnsonCommented:
It should do it automatically.  It does with all the apps I've written with treeviews in them (regardless of Windows and Delphi version).

Stu
0
 
gretzky_owns_uAuthor Commented:
It doesn't. I use dmAutomatic drag mode.  I've found the code:
  If (y < 15) then //upper edge - scroll up
    SendMessage(tv.Handle, WM_VSCROLL, SB_LINEUP, 0)
  else If (tv.Height-y < 15) then //lower edge - scroll down
    SendMessage(tv.Handle, WM_VSCROLL, SB_LINEDOWN, 0);

  if (x < 15) then //left edge - scoll left
    SendMessage(tv.Handle, WM_HSCROLL, SB_LINELEFT, 0)
  else if (tv.Width - x < 15) then //right edge - scroll right
    SendMessage(tv.Handle, WM_HSCROLL, SB_LINERIGHT, 0);

0
 
CleanupPingCommented:
gretzky_owns_u:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
moduloCommented:
PAQed, with points refunded (20)

modulo
Community Support Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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