How can I associate ContextMenuStrip toToolStripMenuItem in VB2005
eg: To associate ContextMenuStrip to a textbox, we write this:
me
.textbox1.ContextMenuStrip = ContextMenuStrip1Please help.
How can I associate ContextMenuStrip toToolStripMenuItem in VB2005
eg: To associate ContextMenuStrip to a textbox, we write this:
me
.textbox1.ContextMenuStrip = ContextMenuStrip1Please help.
associate ContextMenuStrip toToolStripMenuItem
BZM
Hi,
But if the menu item contains file name (i.e. as the desktop toolbar in windows which exists near the system clock), you can right-click any file name and choose to delete or open ... the file.
The same in Favourites -> any file chosen, and look at the context menu.
The same way, my program have menu item contains file name. and so on.
Regards.
Alwin
Hi,
You're correct, but Desktop menu and Favorites menu are both Windows menus listing files, I believe they have different implementation.
Windows Forms menus are for applications and have the mentioned behavior above. I'm moving your post to Windows Forms forum to see if any experts can help with that.
A possible work-around is to associate a context menu to your menu strip and apply the action on the selected menu item.
Best regards,
maag008
Hi,
Looking at existing applications I don't think you can have a context menu for a single menu item. For example in Microsoft Word, right clicking on File | New will not show any context menu.
However, you can associate a context menu with the MenuStrip containing the menu items. For example, in Microsoft Word, right clicking on the whole File | Edit | View ... menu strip shows the context menu for showing / hiding menu strips.
Me
.MenuStrip.ContextMenu = ContextMenuStrip1Best regards,