次の方法で共有


DataGrid.HitTestInfo.ToString メソッド

定義

型、行番号、および列番号を取得します。

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

戻り値

String

型、行番号、および列番号。

次の例では、ユーザーがクリックしたときに型、行番号、列番号を 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

適用対象

こちらもご覧ください