DataGridView.HitTestInfo.RowIndex プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGridView.HitTestInfo.RowIndex プロパティの意味・解説 

DataGridView.HitTestInfo.RowIndex プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

現在の DataGridView.HitTestInfo で表される座標を含む行のインデックス取得します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Dim instance As HitTestInfo
Dim value As Integer

value = instance.RowIndex
public int RowIndex { get;
 }
public:
property int RowIndex {
    int get ();
}
/** @property */
public int get_RowIndex ()

プロパティ
現在の DataGridView.HitTestInfo表される座標を含む DataGridView の行のインデックス

使用例使用例

このプロパティ使用方法を示すコード例次に示します。この例は DataGridView.Columns プロパティリファレンス トピック取り上げている例の一部です。

Private clickedCell As DataGridViewCell

Private Sub dataGridView1_MouseDown(ByVal
 sender As Object, _
    ByVal e As MouseEventArgs) Handles
 dataGridView1.MouseDown

    ' If the user right-clicks a cell, store it for use by the 
    ' shortcut menu.
    If e.Button = MouseButtons.Right Then
        Dim hit As DataGridView.HitTestInfo
 = _
            dataGridView1.HitTest(e.X, e.Y)
        If hit.Type = DataGridViewHitTestType.Cell Then
            clickedCell = _
                dataGridView1.Rows(hit.RowIndex).Cells(hit.ColumnIndex)
        End If
    End If

End Sub
private DataGridViewCell clickedCell;

private void dataGridView1_MouseDown(object
 sender, MouseEventArgs e)
{
// If the user right-clicks a cell, store it for use by the shortcut
 menu.
    if (e.Button == MouseButtons.Right)
    {
        DataGridView.HitTestInfo hit = dataGridView1.HitTest(e.X, e.Y);
        if (hit.Type == DataGridViewHitTestType.Cell)
        {
            clickedCell =
                dataGridView1.Rows[hit.RowIndex].Cells[hit.ColumnIndex];
        }
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridView.HitTestInfo クラス
DataGridView.HitTestInfo メンバ
System.Windows.Forms 名前空間
DataGridView クラス
DataGridView.HitTest


このページでは「.NET Framework クラス ライブラリ リファレンス」からDataGridView.HitTestInfo.RowIndex プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からDataGridView.HitTestInfo.RowIndex プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDataGridView.HitTestInfo.RowIndex プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

DataGridView.HitTestInfo.RowIndex プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataGridView.HitTestInfo.RowIndex プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS