CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2000
    Posts
    163

    Menu Items at RunTime

    Hello

    Is any body know how can I add/remove Item from menu at Runtime ?

    Thank you for help


  2. #2
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: Menu Items at RunTime

    Add them all at design time and set the Visible=False at run time.
    Behind the scenes VB will actually remove the menu.

    HTH,
    Duncan

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  3. #3
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: Menu Items at RunTime

    Make a control array of your menu item, ie., when creating a menu item, mnuItem, set its Index to 0. Then, during Runtime, you can Load mnuItem(1), Load mnuItem(2) and so on. Use Unload to remove them. If you need to remove menu items added during designtime, you need to make a series of calls to API functions GetMenu(), GetSubMenu(), and RemoveMenuItem().


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