Context menu strip

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
 
K

Kevin Spencer

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.
 
S

steffen_home_92

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
 
K

Kevin Spencer

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.
 

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