DataGridViewHitTestType 列挙体とは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGridViewHitTestType 列挙体の意味・解説 

DataGridViewHitTestType 列挙体

メモ : この列挙体は、.NET Framework version 2.0新しく追加されたものです。

DataGridView コントロール内の位置指定します

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

Public Enumeration DataGridViewHitTestType
Dim instance As DataGridViewHitTestType
public enum DataGridViewHitTestType
public enum class DataGridViewHitTestType
public enum DataGridViewHitTestType
public enum DataGridViewHitTestType
メンバメンバ
 メンバ説明
CellDataGridView 内のセル。 
ColumnHeaderDataGridView 内のヘッダー。 
HorizontalScrollBarDataGridViewスクロール バー。 
NoneDataGridView空白部分。 
RowHeaderDataGridView 内のヘッダー。 
TopLeftHeaderDataGridView 内の左上隅にある列ヘッダー。 
VerticalScrollBarDataGridView の垂直スクロール バー。 
解説解説

DataGridView.HitTestInfo は、DataGridView コントロール上の座標ペア表しますType プロパティは、指定した位置含まれる 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];
        }
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
System.Windows.Forms 名前空間
DataGridView クラス
DataGridView.HitTest
DataGridView.HitTestInfo クラス



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

辞書ショートカット

すべての辞書の索引

DataGridViewHitTestType 列挙体のお隣キーワード
検索ランキング

   

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



DataGridViewHitTestType 列挙体のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS