src/Misc/EFTools/DesignXmlCore/VirtualTreeGrid/UI/VirtualTreeControl.cs
/// <summary>
///     Retrieves the index of the item at the given coordinates
/// </summary>
/// <param name="x">The x position, in client coordinates</param>
/// <param name="y">The y position, in client coordinates</param>
/// <returns>An index, or VirtualTreeConstant.NullIndex if there is no item at this location</returns>
Retrieves the index of the item at the given coordinates
Retrieves the index of the item at the given coordinates
public int IndexFromPoint(int x, int y)
        {
            NativeMethods.RECT r;
            var hr = NativeMethods.GetClientRect(Handle, out r);
            if (NativeMethods.Succeeded(hr)
                && r.left <= x
                && x < r.right
                && r.top <= y
                && y < r.bottom)
            {
                var index = (int)NativeMethods.SendMessage(Handle, NativeMethods.LB_ITEMFROMPOINT, 0, (int)NativeMethods.MAKELPARAM(x, y));
                if (NativeMethods.UnsignedHIWORD(index) == 0)
                {
                     Inside ListBox client area			   
                    return NativeMethods.UnsignedLOWORD(index);
                }
            }
            return VirtualTreeConstant.NullIndex;
        }
public int IndexFromPoint ( int x , int y ) { NativeMethods . RECT r ; var hr = NativeMethods . GetClientRect ( Handle , out r ) ; if ( NativeMethods . Succeeded ( hr ) && r . left <= x && x < r . right && r . top <= y && y < r . bottom ) { var index = ( int ) NativeMethods . SendMessage ( Handle , NativeMethods . LB_ITEMFROMPOINT , 0 , ( int ) NativeMethods . MAKELPARAM ( x , y ) ) ; if ( NativeMethods . UnsignedHIWORD ( index ) == 0 ) { return NativeMethods . UnsignedLOWORD ( index ) ; } } return VirtualTreeConstant . NullIndex ; }
Retrieves the index of the item at the given coordinates
Retrieves the index of the item at the given coordinates
//NT4 SP6A : SendMessage Fails. So First check whether the point is in Client Co-ordinates and then //call Sendmessage. // // Inside ListBox client area			   
An index, or VirtualTreeConstant.NullIndex if there is no item at this location
An index or VirtualTreeConstant . NullIndex if there is no item at this location
x
int
The x position, in client coordinates
The x position in client coordinates
y
int
The y position, in client coordinates
The y position in client coordinates