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.
Re: Disable TreeView auto scrolling...
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.
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.
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.
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.