DataGrid.HitTestInfo.ToString DataGrid.HitTestInfo.ToString DataGrid.HitTestInfo.ToString DataGrid.HitTestInfo.ToString Method

定义

获取类型、行号和列号。Gets the type, row number, and column number.

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

返回

类型、行号和列号。The type, row number, and column number.

示例

下面的示例输出类型、 行号和列号,当用户单击System.Windows.Forms.DataGridThe 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 {0}", myHitTest->ToString() );
   }
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());
}
   
Private Sub dataGrid1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
    Dim myHitTest As System.Windows.Forms.DataGrid.HitTestInfo
    ' 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()))
End Sub 'dataGrid1_MouseDown

适用于

另请参阅