ContextMenuStrip

Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Mar 2009
Posts: 40
Reputation: VIPER5646 is an unknown quantity at this point 
Solved Threads: 0
VIPER5646's Avatar
VIPER5646 VIPER5646 is offline Offline
Light Poster

ContextMenuStrip

 
0
  #1
15 Days Ago
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.

  1. Private Sub CustomerPopMenu_ItemClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs)
  2.  
  3. Select Case e.ClickedItem.ToString()
  4.  
  5. Case "Edit"
  6. MsgBox("Edit")
  7.  
  8. Case "Delete"
  9. MsgBox("Delete")
  10. End Select
  11.  
  12. End Sub
Last edited by peter_budo; 15 Days Ago at 5:32 am. Reason: Correcting code tgas
Viper
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,552
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 452
Moderator
adatapost's Avatar
adatapost adatapost is offline Offline
Posting Maven
 
0
  #2
15 Days Ago
Handles clause is missing with Event handler.
Failure is not fatal, but failure to change might be. - John Wooden
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 40
Reputation: VIPER5646 is an unknown quantity at this point 
Solved Threads: 0
VIPER5646's Avatar
VIPER5646 VIPER5646 is offline Offline
Light Poster
 
0
  #3
15 Days Ago
Thank you Adatapost for your reply
I have added the event handler but still nothing happens.
Could I have the wrong event handler ?
  1. Private Sub NoteGrid_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles NoteGrid.CellContentClick
Last edited by peter_budo; 15 Days Ago at 3:45 pm. Reason: Correct code tags, please be carefull when using them
Viper
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 40
Reputation: VIPER5646 is an unknown quantity at this point 
Solved Threads: 0
VIPER5646's Avatar
VIPER5646 VIPER5646 is offline Offline
Light Poster
 
0
  #4
15 Days Ago
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 ?
   
  1. Private Sub Custnotemenu_ItemClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles Custnotemenu.ItemClicked
Viper
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 40
Reputation: VIPER5646 is an unknown quantity at this point 
Solved Threads: 0
VIPER5646's Avatar
VIPER5646 VIPER5646 is offline Offline
Light Poster
 
0
  #5
15 Days Ago
I have solved it.
I just needed to create a right click event and add the custnotemenu.show
Viper
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC