Udostępnij za pośrednictwem


DataGrid.HitTestInfo.ToString Metoda

Definicja

Pobiera typ, numer wiersza i numer kolumny.

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

Zwraca

String

Typ, numer wiersza i numer kolumny.

Przykłady

Poniższy przykład wyświetla typ, numer wiersza i numer kolumny, gdy użytkownik kliknie System.Windows.Forms.DataGridelement .

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

Dotyczy

Zobacz też