Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

DataGrid.HitTestInfo.ToString Method

Gets the type, row number, and column number.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public override string ToString()

Return Value

Type: System.String
The type, row number, and column number.

The following example prints the type, row number, and column number when the user clicks the System.Windows.Forms.DataGrid.

private void dataGrid1_MouseDown
(object sender, System.Windows.Forms.MouseEventArgs e)
{
   System.Windows.Forms.DataGrid.HitTestInfo myHitTest;
   // Use the DataGrid control's HitTest method with the x and y properties.
   myHitTest = dataGrid1.HitTest(e.X,e.Y);
   Console.WriteLine("ToString " + myHitTest.ToString());
}
   

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft