Click to See Complete Forum and Search --> : Context menu


sonia.sardana
June 22nd, 2009, 01:34 PM
Hey frnds i want to show context menu on drop down menu item right click...As an example,Suppose we add bookmark in mozilla & when we right click on that item..context menu is showing.
..How to do that..can somebody plz tell tell me..


Private Sub MenuAddToFavorites_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MenuAddToFavorites.MouseDown

If e.Button = Windows.Forms.MouseButtons.Right Then
'ContextMenuFavorites.Show(e.Location)
ContextMenuFavorites.Show(DirectCast(sender, ToolStripMenuItem).GetCurrentParent.PointToScreen(e.Location))
End If
End Sub


Problem is dat when i right click,context menu is showing..& menu disappeared..But i want that menu should not be disappeared,..

HanneSThEGreaT
June 23rd, 2009, 02:36 AM
Not easy... :)

I see you have asked a lot of places. I basically made an example for you, based on this code :

http://www.daniweb.com/forums/thread198265.html#

Have a look at the attachment.

I hope it helps :)

sonia.sardana
June 23rd, 2009, 02:52 PM
Sir thx for the help..But in this context menu is showing on Testing..I want to show it when i right on Testing123..I hope u understand what i want to say......

HanneSThEGreaT
June 24th, 2009, 07:08 AM
I'll see what I can come up with, or what I can find out :)

have you at least tried playing around with code yourself as well ¿

sonia.sardana
June 24th, 2009, 12:47 PM
Ya many times...But no luck....

HanneSThEGreaT
June 25th, 2009, 01:54 AM
I told you I'd find out :D

We ( I ) were being too complicated.

Have a look at this thread :

http://www.vbforums.com/showthread.php?t=574003

And here is the sample based on the given code

Have fun!