Context menu strip

  • Thread starter Thread starter steffen_home_92
  • Start date Start date
S

steffen_home_92

hi ng,

I actually want to program an application whose main window contains a
menu strip and a tree view control. In the main menu there are items I
want to use for a context menu strip in the tree view but if I add a
menu item from the main menu strip to a context menu it disappears from

the main menu. Additionaly there's no (!) Clone-methode in the
ToolStripMenuItem class, so I can't just copy the menu item at runtime.

Can anybody help me?

Thanks,
Steffen
 
A Control an only belong to the Controls Collection of 1 other Control. So,
if you add a Control to another Control's Controls Collection, it is
automatically removed from the Controls Collection it was previously in. The
Solution is, of course, to use 2 MenuItems, one for the Main Menu, and one
for the Context Menu Strip.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

This is, by definition, not that.
 
Thank you, but there's really no other way than copying the whole menu
items using the VS2005 designer? Why doesn't ToolStripMenuItem have a
Clone() methode?

Steffen
 
Thank you, but there's really no other way than copying the whole menu
items using the VS2005 designer?

Well, there is one other way. You could write the code that creates the
ToolStripMenuItem instance by hand.
Why doesn't ToolStripMenuItem have a
Clone() methode?

I have no idea.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

This is, by definition, not that.
 
Back
Top