Private Sub DataGridView_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGridView.MouseUp
If e.Button = MouseButtons.Right Then
Dim hti As DataGridView.HitTestInfo = sender.HitTest(e.X, e.Y)
If hti.Type = DataGridViewHitTestType.Cell Then
If Not DataGridView.Rows(hti.RowIndex).Selected Then
' User right clicked a row that is not selected, so throw away all other selections and select this row
DataGridView.ClearSelection()
DataGridView.Item(1, hti.RowIndex).Selected = True '해당 마우스 좌표의 셀 선택
End If
End If
End If
End Sub
행 선택하기
Me.DataGridView.Rows(RowIndex).Selected = True
'개발 > Visual Basic' 카테고리의 다른 글
[VB] 텍스트 파일 읽어 오기 (0) | 2011.01.28 |
---|---|
IsNumeric 함수 - 숫자인지 구분하는 함수 (0) | 2010.05.01 |
비주얼 베이직에서 파일로 된 자료 전체 검색 질의문 (0) | 2010.05.01 |