GrapeCity.Xaml.SpreadSheet.UI
HitTest Method
Example 


GrapeCity.Xaml.SpreadSheet.UI Namespace > GcSpreadSheet Class : HitTest Method
The X coordinate.
The Y coordinate.
Performs a hit test.
Syntax
'Declaration
 
Public Function HitTest( _
   ByVal x As Double, _
   ByVal y As Double _
) As HitTestInformation
'Usage
 
Dim instance As GcSpreadSheet
Dim x As Double
Dim y As Double
Dim value As HitTestInformation
 
value = instance.HitTest(x, y)
public HitTestInformation HitTest( 
   double x,
   double y
)

Parameters

x
The X coordinate.
y
The Y coordinate.
Example
This example uses the HitTest method.
gcSpreadSheet1.CanCellOverflow = true;

private void gcSpreadSheet1_PointerPressed(object sender, PointerRoutedEventArgs e)
        {           
            GrapeCity.Xaml.SpreadSheet.UI.HitTestInformation info = gcSpreadSheet1.HitTest(e.GetCurrentPoint(gcSpreadSheet1).Position.X, e.GetCurrentPoint(gcSpreadSheet1).Position.Y);
            if (info.HitTestType == GrapeCity.Xaml.SpreadSheet.UI.HitTestType.Corner)
                gcSpreadSheet1.Sheets[0].SetText(0, 0, "Click SheetCorner of control");
            if (info.HeaderInfo != null)
            {
                if (info.HeaderInfo.InColumnResize)
                    gcSpreadSheet1.Sheets[0].SetText(0, 0, "Column" + info.HeaderInfo.Column.ToString() + " is resizing");
                else if (info.HeaderInfo.InRowResize)
                    gcSpreadSheet1.Sheets[0].SetText(0, 0, "Row" + info.HeaderInfo.Row.ToString() + " is resizing");
            }
        }
GcSpreadSheet1.CanCellOverflow = True

Private Sub gcSpreadSheet1_PointerPressed(sender As Object, e As PointerRoutedEventArgs) Handles gcSpreadSheet1.PointerPressed
        Dim info As GrapeCity.Xaml.SpreadSheet.UI.HitTestInformation = gcSpreadSheet1.HitTest(e.GetCurrentPoint(gcSpreadSheet1).Position.X, e.GetCurrentPoint(gcSpreadSheet1).Position.Y)
        If (info.HitTestType = GrapeCity.Xaml.SpreadSheet.UI.HitTestType.Corner) Then
            gcSpreadSheet1.Sheets(0).SetText(0, 0, "Click SheetCorner of control")
        End If
        If (info.HeaderInfo IsNot Nothing) Then
            If (info.HeaderInfo.InColumnResize) Then
                gcSpreadSheet1.Sheets(0).SetText(0, 0, "Column" + info.HeaderInfo.Column.ToString() + " is resizing")
            ElseIf (info.HeaderInfo.InRowResize) Then
                gcSpreadSheet1.Sheets(0).SetText(0, 0, "Row" + info.HeaderInfo.Row.ToString() + " is resizing")
            End If
        End If
    End Sub
See Also

Reference

GcSpreadSheet Class
GcSpreadSheet Members