[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Using bitmaps in menu items

Posted on 1998-07-22
5
Medium Priority
?
154 Views
Last Modified: 2010-05-03
How do you use the API in order to attach bitmap images to items in a drop down menu?
0
Comment
Question by:rossom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
jjmartin earned 100 total points
ID: 1466411
Here is some code that will add the bitmaps to your menu.

 Dim i%
  Dim hMenu, hSubMenu, menuID, x
  hMenu = GetMenu(hwnd)
  hSubMenu = GetSubMenu(hMenu, 0) '1 for "Other" menu etcetera
  For i = 1 To 4
    menuID = GetMenuItemID(hSubMenu, i - 1)
    x = SetMenuItemBitmaps(hMenu, menuID, &H4, img.ListImages(i).Picture, img.ListImages(i).Picture)
  Next
  menuID = GetMenuItemID(hSubMenu, 5)
  x = SetMenuItemBitmaps(hMenu, menuID, 0, img.ListImages(5).Picture, 0&)
0
 
LVL 7

Expert Comment

by:tward
ID: 1466412
This doesn't seem to work?
0
 
LVL 3

Expert Comment

by:jjmartin
ID: 1466413
It works on my PC running VB5, where is the code failing on you?
0
 
LVL 7

Expert Comment

by:tward
ID: 1466414
 x = SetMenuItemBitmaps(hMenu, menuID, &H4, img.ListImages(i).Picture, img.ListImages(i).Picture)

seems to be returning 0?

I cut your code out to see if it would work so it is exactly as above!

0
 
LVL 7

Expert Comment

by:tward
ID: 1466415
Sorry,

  It does work here also, I had ICONS in the ImageList instead of Bitmaps.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question