次の方法で共有


DataGrid.HitTestInfo.ToString メソッド

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

Overrides Public Function ToString() As String
[C#]
public override string ToString();
[C++]
public: String* ToString();
[JScript]
public override function ToString() : String;

戻り値

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

使用例

[Visual Basic, C#, C++] ユーザーが System.Windows.Forms.DataGrid をクリックしたときに、型、行番号、および列番号を出力する例を次に示します。

 
Protected Sub dataGrid1_MouseDown(sender As Object, 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

[C#] 
protected 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());
}
   

[C++] 
protected:
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(S"ToString {0}", myHitTest->ToString());
}
   

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET

参照

DataGrid.HitTestInfo クラス | DataGrid.HitTestInfo メンバ | System.Windows.Forms 名前空間 | DataGrid | DataGrid.HitTestType | HitTest