Private Sub dgEventLog_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles dgEventLog.MouseUp
Dim Point As Point = Nothing
Dim Hit As DataGridView.HitTestInfo = dgEventLog.HitTest(e.X, e.Y)
Dim CellIndex As Integer = 0
If Hit.Type = DataGridViewHitTestType.Cell Then
CellIndex = Hit.ColumnIndex
End If
If Hit.RowIndex >= 0 Then
dgEventLog.ClearSelection()
dgEventLog.CurrentCell = dgEventLog.Rows(Hit.RowIndex).Cells(CellIndex)
dgEventLog.Rows(Hit.RowIndex).Selected = True
If dgEventLog.SelectedRows.Count = 1 Then
If e.Button = Windows.Forms.MouseButtons.Right Then
Point = New Point(Cursor.Position.X, Cursor.Position.Y)
Point = sender.PointToClient(Point)
cmEventLog.Show(sender, Point)
End If
End If
End If
End Sub