Show Context Menu

Latest post 09-15-2009 8:09 AM by Nick. 0 replies.
  • 09-15-2009 8:09 AM

    • Nick
    • Top 10 Contributor
    • Joined on 04-28-2008
    • Posts 27

    Show Context Menu

        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

Page 1 of 1 (1 items) | RSS
Forums to discuss Microsoft ASP.Net Development and SQL
Powered by Community Server (Non-Commercial Edition), by Telligent Systems