[]
Returns information about the control at a specified point on the control surface.
public HitTestInfo HitTest(int x, int y)
Type | Name | Description |
---|---|---|
int | x | The horizontal position of the client coordinate. |
int | y | The vertical position of the client coordinate. |
Type | Description |
---|---|
HitTestInfo | A HitTestInfo object that contains information about the point. |
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.
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);
}
Returns information about the control at a specified point on the control surface.
public HitTestInfo HitTest(Point pt)
Type | Name | Description |
---|---|---|
Point | pt | Point in client coordinates. |
Type | Description |
---|---|
HitTestInfo | A HitTestInfo object that contains information about the point. |
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.
Returns information about the control at the current mouse position.
public HitTestInfo HitTest()
Type | Description |
---|---|
HitTestInfo | A HitTestInfo object that contains information about the point. |