|
-
Jan 4th, 2001, 02:55 PM
#1
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/
-
Jan 4th, 2001, 10:31 PM
#2
Member
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.
-
Jan 5th, 2001, 04:24 PM
#3
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
|