Hi
I have seen in these posts how to get the node from the MouseEnterElement event. But, how do I get the column at the current mouse position?
Thanks
Jerry
Magued
Fantastic!
Works fine - greate site you put me onto.
Thanks loads.
Private Sub ultraTree1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)
Dim tree As UltraTree = DirectCast(sender, UltraTree)
Dim p As New Point(e.X, e.Y)
Dim element As UIElement = tree.UIElement.ElementFromPoint(p)
If element IsNot Nothing Then
Dim cell As UltraTreeNodeCell = TryCast(element.GetContext(GetType(UltraTreeNodeCell)), UltraTreeNodeCell)
If cell IsNot Nothing Then
Dim column As UltraTreeNodeColumn = cell.Column
End If
End Sub
Please refer to the following site for conversion from C# to VB.NET
http://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx
Hmm
Mike, I have tried to do this but my c# is not good and I am trying to convert your code to VB - any chance you can help?
Mike
Thanks for that - I'll try that shortly.
Regards
Hi Jerry,
Something like this:
private void ultraTree1_MouseMove(object sender, MouseEventArgs e) { UltraTree tree = (UltraTree)sender; Point p = new Point(e.X, e.Y); UIElement element = tree.UIElement.ElementFromPoint(p); if (element != null) { UltraTreeNodeCell cell = element.GetContext(typeof(UltraTreeNodeCell)) as UltraTreeNodeCell; if (cell != null) { UltraTreeNodeColumn column = cell.Column; } } }
You may want to check out the Infragistics UIElementViewer Utility. It's a big help when working with UIElements like this.