Spread Silverlight Documentation
GrapeCity.Windows.SpreadSheet.UI Namespace / HitTestType Enumeration
Example Example


In This Topic
    HitTestType Enumeration
    In This Topic
    Specifies the locations in the component for the HitTest method.
    Syntax
    'Declaration
     
    Public Enum HitTestType 
       Inherits System.Enum
    'Usage
     
    Dim instance As HitTestType
    public enum HitTestType : System.Enum 
    Members
    MemberDescription
    ColumnHeaderSpecifies that the location is in the column header area of the component.
    ColumnRangeGroupSpecifies that the location is in the column range group of the component.
    ColumnSplitBarSpecifies that the location is in the column splitter bar area of the component.
    ColumnSplitBoxSpecifies that the location is in the column split box of the component.
    CornerSpecifies that the location is in the upper left sheet corner of a workbook.
    CornerRangeGroupSpecifies that the location is in the range group corner of the component.
    EmptySpecifies an empty location.
    FloatingObject 
    FormulaSelection 
    HorizontalScrollBarSpecifies that the location is in the horizontal scroll bar of the component.
    RowHeaderSpecifies that the location is in the row header area of the component.
    RowRangeGroupSpecifies that the location is in the row range group of the component.
    RowSplitBarSpecifies that the location is in the row splitter bar area of the component.
    RowSplitBoxSpecifies that the location is in the row split box of the component.
    TabSplitBoxSpecifies that the location is in the tab split box of the component.
    TabStripSpecifies that the location is in the sheet name tab area of the component.
    VerticalScrollBarSpecifies that the location is in the vertical scroll bar of the component.
    ViewportSpecifies that the location is in a viewport of the data area of the component.
    Example
    This example uses the HitTestType enumeration.
    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
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             GrapeCity.Windows.SpreadSheet.UI.HitTestType

    See Also