HI

I'm trying to use a menu on a datagridview, I have put a Contextmenutrip on the form. When I right click in a cell
I would like a menu to pop up. but nothing happens.
This is the code I have tried.

Private Sub CustomerPopMenu_ItemClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs)

        Select Case e.ClickedItem.ToString()

            Case "Edit"
                MsgBox("Edit")

            Case "Delete"
                MsgBox("Delete")
        End Select

    End Sub

Handles clause is missing with Event handler.

Thank you Adatapost for your reply
I have added the event handler but still nothing happens.
Could I have the wrong event handler ?

Private Sub NoteGrid_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles NoteGrid.CellContentClick

Sorry I wrote down the wrong event
this is the correct new event
Thank you Adatapost for your reply
I have added the event handler but still nothing happens.
Could I have the wrong event handler ?

Private Sub Custnotemenu_ItemClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles Custnotemenu.ItemClicked [/CODE] 

I have solved it.
I just needed to create a right click event and add the custnotemenu.show

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.