FlexGrid for WinForms
HitTest(Int32,Int32) Method
Example 



The horizontal position of the client coordinate.
The vertical position of the client coordinate.
Returns information about the control at a specified point on the control surface.
Syntax
'Declaration
 
Public Overloads Function HitTest( _
   ByVal x As Integer, _
   ByVal y As Integer _
) As HitTestInfo
'Usage
 
Dim instance As C1FlexGridBase
Dim x As Integer
Dim y As Integer
Dim value As HitTestInfo
 
value = instance.HitTest(x, y)
public HitTestInfo HitTest( 
   int x,
   int y
)
public:
HitTestInfo HitTest( 
   int x,
   int y
) 

Parameters

x
The horizontal position of the client coordinate.
y
The vertical position of the client coordinate.

Return Value

A HitTestInfo object that contains information about the point.
Remarks
This method is especially useful when handling the BeforeMouseDown event. It allows you to determine whether the mouse is over a specific cell, grid buttons, resizing elements, etc.
Example
The code below shows hit test information whenever the user clicks the mouse:
void _flex_BeforeMouseDown(object sender, BeforeMouseDownEventArgs e)
{
  HitTestInfo hti = _flex.HitTest(e.X, e.Y);
  Console.WriteLine("at {0},{1}: row {2} col {3} type {4}",
                     hti.X, hti.Y, hti.Row, hti.Column, hti.Type);
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

C1FlexGridBase Class
C1FlexGridBase Members
Overload List

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Send Feedback