Spread Silverlight Documentation
HitTest(Double,Double) Method
Example 


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

Parameters

x
The X coordinate.
y
The Y coordinate.
Example
This example uses the HitTest method.
gcSpreadSheet1.CanCellOverflow = true;
void gcSpread1_MouseDown(object sender, MouseButtonEventArgs e)
        {
            HitTestInformation info = gcSpreadSheet1.HitTest(e.GetPosition(gcSpreadSheet1).X, e.GetPosition(gcSpreadSheet1).Y);
            if (info.HitTestType == 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_MouseDown(sender As System.Object, e As System.Windows.Input.MouseButtonEventArgs)
        Dim info As HitTestInformation = GcSpreadSheet1.HitTest(e.GetPosition(GcSpreadSheet1).X, e.GetPosition(GcSpreadSheet1).Y)
        If (info.HitTestType = 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