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

A

academic

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(ContextMenuControlWindowsExplorer, 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.MainMenuFormWindowsExplorerTool, MenuStripThis)

ToolStripManager.Merge(ControlWindowsExplorer1.GetContextMenuControlWindowsExplorer,
MenuStripThis)

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top