Disable TreeView auto scrolling...
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Disable TreeView auto scrolling...

  1. #1
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    1,384

    Disable TreeView auto scrolling...

    Hi *!
    I have a TreeView in my application. The problem I am having with TreeView is that if I expand one the ParentItem that contains "many" children, the TreeView automatically scrolls the ParentItem to the top so that maximum number of child items can be displayed in the TreeView client area. I don't want this behaviour. Is there any flag or something that can change this behaviour so that the TreeView never scrolls "automatically"??????
    Thanks for your time,
    Regards,
    Usman.

  2. #2
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    1,384

    Re: Disable TreeView auto scrolling...

    Anyone????

  3. #3
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Disable TreeView auto scrolling...

    There is no such flag. You can see all the tree view styles at Tree-View Control Window Styles from MSDN.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  4. #4
    Join Date
    Aug 2001
    Location
    Germany
    Posts
    1,384

    Re: Disable TreeView auto scrolling...

    Yep I know those styles, I thought may be someone knows a trick that can turn this off . Thanks anyways.
    Regards,
    Usman.

  5. #5
    Join Date
    Aug 2013
    Posts
    1

    Re: Disable TreeView auto scrolling...

    I'm running into the same problem with C#/.NET. This is especially troublesome because if the user double-clicks to open a node tree, the double-click, after the node tree is expanded and brought to the top of the display, extends down to the item that is in the position where the old parent node was located.

  6. #6
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,362

    Re: Disable TreeView auto scrolling...

    Sorry, don't know c#/.net. But one possible way of doing this in c/c++ using the standard windows API is to check for the TVN_ITEMEXPANDING notification and use TreeView_GetFirstVisible(..) to get the handle of the first visible item. Then for the TVN_ITEMEXPANDED notification, use TreeViev_EnsureVisible(..) with the handle obtained from the previous TreeView_GetFirstVisible.
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center