0

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

Edited by peter_budo: Correcting code tgas

2
Contributors
4
Replies
7
Views
8 Years
Discussion Span
Last Post by VIPER5646
0

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

Edited by peter_budo: Correct code tags, please be carefull when using them

0

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] 

Edited by Reverend Jim: Fixed formatting

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.