By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,144 Members | 1,250 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,144 IT Pros & Developers. It's quick & easy.

Having a problem merging a ContextMenuStrip for a UserControl to the MenuStrip on the form

P: n/a
I'm having a problem merging a ContextMenuStrip for a UserControl to the
MenuStrip on the form containing the UserControl.

I tried the following thinking that it is equivalent to cloning the
ContextStrip menu

Thanks for Any helpful suggestions?

On the control

Public ReadOnly Property GetContextMenuControlWindowsExplorer() As
System.Windows.Forms.ContextMenuStrip

Get

Dim tmp As ContextMenuStrip = New ContextMenuStrip

ToolStripManager.Merge(ContextMenuControlWindowsEx plorer, tmp)

'GetContextMenuControlWindowsExplorer = ContextMenuControlWindowsExplorer

GetContextMenuControlWindowsExplorer = tmp

End Get

End Property

On the form

Private Sub FixMenu()

'MenuStripThis is the forms MenuStrip

MenuStripThis.Items.Clear()

ToolStripManager.Merge(Me.MainMenuFormWindowsExplo rerTool, MenuStripThis)

ToolStripManager.Merge(ControlWindowsExplorer1.Get ContextMenuControlWindowsExplorer,
MenuStripThis)

End Sub


Mar 3 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.