Clonemenu

mickn66

Well-known member
Joined
Nov 2, 2002
Messages
53
I cant get this to work. I have a notifyicon in the systemtray. It has a context menu called mnuContextMenu, which is declared as public in a module.

I want to copy that context menu into another menu in a form, but whenever I try

MainMenu1.MenuItems.Add(iconny.ContextMenu.clonemenu())

OR

MainMenu1.menuitems.add(mnuContextMenu.clonemenu())

I am told that I cant do it because mnuContextMenu is "not accesable in this context because it is protected"

Like I said, its actually declared as public. Does anyone have any idea why this is happening and/or how I can copy the context menu of the notifyicon in the system tray to another menu on a form? Please help!
 
What about

[VB]
Dim itm as menuitem

For each itm in mnuContextMenu.MenuItems

MainMenu1.MenuItems.Add(itm)

Next
[/VB]

Would that give you the same error?

edit: changed
For each itm in mnuContextMenu
to
For each itm in mnuContextMenu.MenuItems
 
Last edited by a moderator:

Similar threads

I
Replies
0
Views
164
Ilija Dimitrov
I
T
Replies
0
Views
574
This_display_name_is_already_in_use_They_all_are
T
Back
Top