B
Bill Schanks
VB 2005
How do I tell if a right click on a datagridview is in the selected
cells? I want to selected the cell if it's not, and if it is in the
selected cell range do nothing.
I have this code to select the right clicked cell, but how do I check
if it's in the selected cell range?
Private Sub DataGridView_CellMouseDown(ByVal sender As System.Object,
_
ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) _
Handles DataGridView.CellMouseDown
If e.Button = Windows.Forms.MouseButtons.Right Then
Me.DataGridView.CurrentCell =
Me.DataGridView.Rows(e.RowIndex).Cells(e.ColumnIndex)
End If
End Sub
How do I tell if a right click on a datagridview is in the selected
cells? I want to selected the cell if it's not, and if it is in the
selected cell range do nothing.
I have this code to select the right clicked cell, but how do I check
if it's in the selected cell range?
Private Sub DataGridView_CellMouseDown(ByVal sender As System.Object,
_
ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) _
Handles DataGridView.CellMouseDown
If e.Button = Windows.Forms.MouseButtons.Right Then
Me.DataGridView.CurrentCell =
Me.DataGridView.Rows(e.RowIndex).Cells(e.ColumnIndex)
End If
End Sub