DataGridViewHitTestType DataGridViewHitTestType DataGridViewHitTestType DataGridViewHitTestType Enum

정의

DataGridView 컨트롤의 위치를 지정합니다.Specifies a location in a DataGridView control.

public enum class DataGridViewHitTestType
public enum DataGridViewHitTestType
type DataGridViewHitTestType = 
Public Enum DataGridViewHitTestType
상속
DataGridViewHitTestTypeDataGridViewHitTestTypeDataGridViewHitTestTypeDataGridViewHitTestType

필드

Cell Cell Cell Cell 1

DataGridView의 셀입니다.A cell in the DataGridView.

ColumnHeader ColumnHeader ColumnHeader ColumnHeader 2

DataGridView의 열 머리글입니다.A column header in the DataGridView.

HorizontalScrollBar HorizontalScrollBar HorizontalScrollBar HorizontalScrollBar 5

DataGridView의 가로 스크롤 막대입니다.The horizontal scroll bar of the DataGridView.

None None None None 0

DataGridView의 비어 있는 부분입니다.An empty part of the DataGridView.

RowHeader RowHeader RowHeader RowHeader 3

DataGridView의 행 머리글입니다.A row header in the DataGridView.

TopLeftHeader TopLeftHeader TopLeftHeader TopLeftHeader 4

DataGridView의 왼쪽 위 열 머리글입니다.The top left column header in the DataGridView.

VerticalScrollBar VerticalScrollBar VerticalScrollBar VerticalScrollBar 6

DataGridView의 세로 스크롤 막대입니다.The vertical scroll bar of the DataGridView.

예제

다음 코드 예제에서는이 형식의 사용을 보여 줍니다.The following code example illustrates the use of this type. 이 예제는에서 사용할 수 있는 보다 큰 예제의 일부는 DataGridView.Columns 속성 참조 항목입니다.This example is part of a larger example available in the DataGridView.Columns property reference topic.

   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];
           }
       }
   }
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

설명

A DataGridView.HitTestInfo 좌표 쌍에 설명 합니다.는 DataGridView 제어 합니다.A DataGridView.HitTestInfo describes a coordinate pair on the DataGridView control. 합니다 Type 속성의 어느 부분을 나타냅니다는 DataGridView 지점을 포함 합니다.The Type property indicates which part of the DataGridView contains the point.

적용 대상

추가 정보