-
March 9th, 2006, 11:28 PM
#1
MenuItem.Popup == ToolStripMenuItem.???
I'm working with an old C# book and it is telling me to add a MainMenu to a Form and then set the Form's Menu to this new MainMenu that I've added, but I can't do that because the Form doesn't have a Menu property - just a MainMenuStrip. So I guess I have to use a MenuStrip, which I'm OK with, but the book is also telling me to add an event handler for a MenuItem's Popup event which the ToolStripMenuItem does not have.
Other than the obvious (get a new book), can anyone tell me how to resolve this situation? What is the equivalent of the MenuItem.Popup event?
-
March 10th, 2006, 12:19 AM
#2
Re: MenuItem.Popup == ToolStripMenuItem.???
just use the menustrip instead of mainmenu.
DropDownOpening is what you're looking for to replace popup.
good luck.
-
March 14th, 2006, 10:23 PM
#3
Re: MenuItem.Popup == ToolStripMenuItem.???
Thanks, MadHatter!
Another question...
How about MenuItem.MenuItems = ToolStripMenuItem.???
I found the below article, but it didn't have anything to convert the MenuItem.MenuItems.
http://www.codeproject.com/useritems...oMenuStrip.asp
-
March 15th, 2006, 08:19 AM
#4
Re: MenuItem.Popup == ToolStripMenuItem.???
hey!
popup is all about displaying the menu. if you want to see which menuitem is clicked, you should set onclick event and check...
Code:
ToolStripMenuItem m_ClickItem = (ToolStripMenuItem)sender;
if(m_ClickItem == mytoolstripmenuitemFileOpen)
{
do something
}
If you think you CAN, you can, If you think you CAN'T, you are probably right.
Have some nice Idea to share? Write an Article Online or Email to us and You may WIN a Technical Book from CG.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|