Results 1 to 3 of 3

Thread: AppendMenu URGENT!!

  1. #1
    Guest
    I've seen demos of the API AppendMenu Function, but have no idea how to set where the postion of the menuitem and its name are set.
    I need to add unlimited numbers of menuItems to an index array (mnuFavourite(?)) as menuItems in the menu mnuFavourites. Can anyone help me?

    ricmitch_uk
    [email protected]
    http://switchsoftware.scriptmania.com/

  2. #2
    Member
    Join Date
    Oct 2000
    Posts
    34
    Well, if you're using an array of menu items, there's really no need to use the API. In VB, when you want to add a new menu item at run-time, just use the code:

    Code:
    Sub AddToFavourites(strItemText As String)
      Dim nCount As Long
    
      nCount = mnuFavourites.Count
      Load mnuFavourites(nCount)
    
      mnuFavourites(nCount).Caption = strItemText
      mnuFavourites(nCount).Visible = True
    End Sub
    If you were to use the API functions, the only way to get notification when a user clicks a menu item is to subclass the form for the WM_COMMAND message. If you need the menu to dynamically branch off into user-defined sub menus and such, then you will have to learn the APIs, but otherwise you should be fine with the code above.

  3. #3
    Guest
    Thanx rippin!

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