Un-commenting the top items seems to prove a menu item can only be on one menu at a tie.
Un-commenting the lower items gives an error message - I don't know why.
On the form
On the UserControl code
Looking for insight.
Do you believe a menuitem can only be on one menu at a time?
Why the error message from the second group?
Do you know where there is an example of multiuse of menus?
The entire solution is attached
PS I know I can do this:
Me.ToolStripMenuItem_ForDisplay_TextEditor.DropDown = ControlTextEditor_1.GetContextMenuStripGeneral
Un-commenting the lower items gives an error message - I don't know why.
On the form
VB.NET:
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
'This appears to work but the MenuItes are removed from the ContextMenu
'Appears that a menu item can nt be on two menus
'For i As Integer = 0 To ControlTextEditor_1.GetContextMenuStripGeneralItems.Count - 1
' MenuStrip_ForDisply.Items.Add(ControlTextEditor_1.GetContextMenuStripGeneralItems(i))
'Next
'This give a modifying collection error - do not know why seeing that GetContextMenuStripGeneralItems is not MenuStrip_ForDisply.Items
'For Each z As ToolStripMenuItem In ControlTextEditor_1.GetContextMenuStripGeneralItems
' MenuStrip_ForDisply.Items.Add(z)
'Next
End Sub
End Class
On the UserControl code
VB.NET:
Public ReadOnly Property GetContextMenuStripGeneralItems() As ToolStripItemCollection
Get
Return ContextMenuStrip_General.Items
End Get
End Property
Looking for insight.
Do you believe a menuitem can only be on one menu at a time?
Why the error message from the second group?
Do you know where there is an example of multiuse of menus?
The entire solution is attached
PS I know I can do this:
Me.ToolStripMenuItem_ForDisplay_TextEditor.DropDown = ControlTextEditor_1.GetContextMenuStripGeneral
Attachments
Last edited: