DataGrid.HitTestInfo クラス
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


DataGrid.HitTestInfo クラスは、DataGrid コントロール内のどの部分をユーザーがクリックしたかを判断するために、DataGrid コントロールの HitTest メソッドと組み合わせて使用されます。DataGrid.HitTestInfo クラスには、行、列、およびグリッド内のクリックされた部分に関する情報が格納されます。グリッドの各部の詳細については、Type プロパティで返される DataGrid.HitTestType 列挙値を参照してください。
DataGrid.HitTestInfo を返すには、DataGrid コントロールの MouseDown イベントから HitTest メソッドを呼び出します。その際、MouseEventArgs の x プロパティと y プロパティを HitTest メソッドに渡します。

MouseDown イベントで HitTest メソッドを呼び出し、DataGrid.HitTestInfo オブジェクトを返す例を次に示します。行、列、およびグリッドの部分に関する情報が出力されます。
Private Sub DataGrid1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Console.WriteLine() Dim myHitTest As DataGrid.HitTestInfo ' Use the DataGrid control's HitTest method with the x and y properties. myHitTest = DataGrid1.HitTest(e.X, e.Y) Console.WriteLine("Column " & myHitTest.Column) Console.WriteLine("Row " & myHitTest.Row) Console.WriteLine("Type " & myHitTest.Type) Console.WriteLine("ToString " & myHitTest.ToString) Console.WriteLine("Format " & myHitTest.Type.ToString) End Sub
private void dataGrid1_MouseDown (object sender, System.Windows.Forms.MouseEventArgs e) { Console.WriteLine(); 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(myHitTest); Console.WriteLine("Column " + myHitTest.Column); Console.WriteLine("Row " + myHitTest.Row); Console.WriteLine("Type " + myHitTest.Type); Console.WriteLine("ToString " + myHitTest.ToString()); Console.WriteLine("Hit " + myHitTest.Type.ToString()); }
private: void dataGrid1_MouseDown( Object^ /*sender*/, System::Windows::Forms::MouseEventArgs^ e ) { Console::WriteLine(); 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( myHitTest ); Console::WriteLine( "Column {0}", myHitTest->Column ); Console::WriteLine( "Row {0}", myHitTest->Row ); Console::WriteLine( "Type {0}", myHitTest->Type ); Console::WriteLine( "ToString {0}", myHitTest ); Console::WriteLine( "Hit {0}", myHitTest->Type ); }

System.Windows.Forms.DataGrid.HitTestInfo


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DataGrid.HitTestInfo メンバ
System.Windows.Forms 名前空間
DataGrid.CurrentCell プロパティ
GetCellBounds
HitTest
DataGrid.HitTestType
DataGrid.HitTestInfo フィールド


関連項目
DataGrid.HitTestInfo クラスSystem.Windows.Forms 名前空間
DataGrid.CurrentCell プロパティ
GetCellBounds
HitTest
DataGrid.HitTestType
DataGrid.HitTestInfo プロパティ


関連項目
DataGrid.HitTestInfo クラスSystem.Windows.Forms 名前空間
DataGrid.CurrentCell プロパティ
GetCellBounds
HitTest
DataGrid.HitTestType
DataGrid.HitTestInfo メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 オーバーライドされます。 |
![]() | GetHashCode | オーバーライドされます。 DataGrid.HitTestInfo インスタンスのハッシュ コードを取得します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | オーバーライドされます。 型、行番号、および列番号を取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

関連項目
DataGrid.HitTestInfo クラスSystem.Windows.Forms 名前空間
DataGrid.CurrentCell プロパティ
GetCellBounds
HitTest
DataGrid.HitTestType
DataGrid.HitTestInfo メンバ
System.Windows.Forms.DataGrid 内の指定された座標に位置する部分についての情報を格納します。このクラスは継承できません。
DataGrid.HitTestInfo データ型で公開されるメンバを以下の表に示します。



名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 オーバーライドされます。 |
![]() | GetHashCode | オーバーライドされます。 DataGrid.HitTestInfo インスタンスのハッシュ コードを取得します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | オーバーライドされます。 型、行番号、および列番号を取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

関連項目
DataGrid.HitTestInfo クラスSystem.Windows.Forms 名前空間
DataGrid.CurrentCell プロパティ
GetCellBounds
HitTest
DataGrid.HitTestType
- DataGrid.HitTestInfoのページへのリンク