Hello,
I was testing if it was possible to scroll the ultrawintree if the tree doesnt have focus. I want to be able if the tree doesnt have focus to scroll the tree when the cursor is in the treeregion.
This works for the .NET treeview, but not for the ultrawintree.
Is this even possible with the ultrawintree?
Thanks.
Thanks Mike,
This works indeed.
Hi,
The ScrollDown and ScrollUp actions handle what happens when you press the up or down arrow keys and there is no focus rectangle on the tree. This only applies in the WindowsVista-style tree.
But you can acheive the same thing like so:
private static void ScrollTree(UltraTree tree, bool up) { UltraTreeNode topNode = tree.TopNode; if (topNode == null) return; UltraTreeNode newTopNode = topNode.NextVisibleNode; if (up) { newTopNode = topNode.PrevVisibleNode; } else { newTopNode = topNode.NextVisibleNode; } if (newTopNode != null) tree.TopNode = newTopNode; }
By the way found that it is possible to do performaction on the tree, but when i give the ultratreeaction pageup or pagedown it works, but when i use the scrolldown or scrollup nothing happens.
Ok, thank you.
I know what kind of control is set when the mousewheel is used, can you give a some small example of how i can scroll the tree?
Sorry, perhaps I wasn't clear.
The Microsoft TreeView control is a wrapper for the Windows Tree. So it responds to Windows messages like SendMessage the same way any Windows Tree would.
The Infragistics WinTree is not a wrapper for the Windows Tree. So it will not respond to Windows message like SendMessage.
But if you want determine the control under the mouse and get a reference to that control and find that it's an UltraWinTree, you could simply scroll the tree in code.
Granted, this is not as convenient as using SendMessage, since with SendMessage you don't care what control you are sending the message to. But it should be possible to get it to work.