How come the UltraTree control fires a DoubleClick event, when I doubleclick on the scrollbar?
The result is that DoubleClick fires, when a user is scolling up or down, and is clicking a little bit too fast on the up or down arrows.
Is there a way to disable or work around this feature?
Regards,
Jørn
Hi Joesn,
The reason that most controls don't fire events like Click and DoubleClick when the mouse is on the scrollbar is that the scrollbar is provided by a window style is not part of the client area of the control.
In the case of the Infragistics controls, this is not the case. Infragistics controls use an UltraScrollBar, so this allows the scrollbar to be themed and you can apply appearances to them. So they have more functionality than a regular scrollbar.
I thought that there was a NodeDoubleClick event on UltraWinTree, so if you are only concerned with responding to a double-click on a node, you could use that event. If you want to deal with other parts of the tree (or if I am wrong about the existance of that event), then you need to determine what part of the tree the mouse is over. The best way to do this is to use the UIElements of the tree. Do a search in the Infragistics KnowledgeBase for the "ElementFromPoint" method and this will give you a whole bunch of articles that describes how to determine what part of an an Infragistics control is at a point such as the current location of the mouse.
If you can give me some more specifics about exactly what parts of the tree you are concerned with, I can probably give you more detailed info. But it sounds like you need to get the UIElement that the moue is currently over and then call GetAncestor and try to find a ScrollBarUIElement. If you find one, then you will know the mouse is on a scroll bar and you can skip your DoubleClick event logic.
Also, if you are going to be working with UIElements, I recommend getting the UIElementVewer Utility. It's a big help.
http://geekswithblogs.net/devin/archive/2005/11/17/60406.aspx
Hi Mike.
I am only concerned about the vertical scrollbar.
I have a small application with a hierarchy of physical locations. When the user doubleclicks on an item, a new window opens where he can edit the properties of the location. Recently a user complained that the window opened when he tried to scroll through the list. He simply clicked the "up" arrow a lot of times very quickly.The control thinks it is a double-click.
Unfortunately there is no NodeDoubleClick event, so I think I have to do as you say and use the UIElements.
Thank you,Jørn