CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2005
    Posts
    27

    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?

  2. #2
    Join Date
    Mar 2004
    Location
    33°11'18.10"N 96°45'20.28"W
    Posts
    1,808

    Re: MenuItem.Popup == ToolStripMenuItem.???

    just use the menustrip instead of mainmenu.

    DropDownOpening is what you're looking for to replace popup.

    good luck.

  3. #3
    Join Date
    Aug 2005
    Posts
    27

    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

  4. #4
    Andy Tacker is offline More than "Just Another Member"
    Join Date
    Jun 2001
    Location
    55°50' N 37°39' E
    Posts
    1,503

    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
  •  





Click Here to Expand Forum to Full Width

Featured