GrapeCity MultiRow Windows Forms Documentation
ToString Method (HitTestInfo)
Example 


Returns a System.String that represents the current HitTestInfo.
Syntax
Public Overrides Function ToString() As String
Dim instance As HitTestInfo
Dim value As String
 
value = instance.ToString()
public override string ToString()

Return Value

A System.String that represents the current HitTestInfo.
Example
The following code example shows how to use GcMultiRow's hit test. If you right click the ColumnHeaderSection with the mouse, the clicked cell executes an automatic resize.
void gcMultiRow1_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                HitTestInfo info = gcMultiRow1.HitTest(e.Location);
                if (info.Type == HitTestType.ColumnHeader)
                {
                    //If right click the ColumnHeader, the clicked cell will execute auto fit.
                    this.gcMultiRow1.ColumnHeaders[info.SectionIndex].Cells[info.CellIndex].PerformHorizontalAutoFit();
                }
                label.Text = info.ToString();
            }
        }
Private Sub gcMultiRow1_MouseClick(ByVal sender As Object, ByVal e As MouseEventArgs) Handles gcMultiRow1.MouseClick
        If e.Button = MouseButtons.Right Then
            Dim info As HitTestInfo = gcMultiRow1.HitTest(e.Location)
            If info.Type = HitTestType.ColumnHeader Then
                'If right click the ColumnHeader, the clicked cell will execute auto fit.
                Me.gcMultiRow1.ColumnHeaders(info.SectionIndex).Cells(info.CellIndex).PerformHorizontalAutoFit()
            End If
            label.Text = info.ToString()
        End If
    End Sub
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

HitTestInfo Class
HitTestInfo Members

 

 


Copyright © GrapeCity, inc. All rights reserved.