Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
XML RSS Feed
 
 
 
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitlePut bitmaps in menus
Keywordsmenu, picture, bitmap, image
CategoriesControls
 
This example uses the SetMenuItemInfo API function to add bitmaps to three menu items.
 
Private Sub Form_Load()
Dim main_menu As Long
Dim sub_menu As Long
Dim menu_info As MENUITEMINFO
Dim i As Integer

    main_menu = GetMenu(hwnd)
    sub_menu = GetSubMenu(main_menu, 0)
    For i = 0 To 2
        With menu_info
            .cbSize = Len(menu_info)
            .fMask = MIIM_TYPE
            .fType = MFT_BITMAP
            .dwTypeData = picFace(i).Picture
        End With
        SetMenuItemInfo sub_menu, i, True, menu_info
    Next i
End Sub
 
For a version that uses a wrapper function to make this a little easier, see the example Easily add bitmaps to menus.
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated