VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Multiple Clickable Bitmaps on a drop menu in a for

Patrick K. Bigley  (14 Submissions)   Miscellaneous   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

Very short code! Newly updated and it WORKS! Display bitmaps instead of text on a drop menu, in a form. Use the VB Menu Editor to create a menu with sub menus, the code does the rest!! So easy you will slap yourself for using other people's lengthy drawn-out codes.

Assumes
Create a form (Form1) Add a module (Module1) Add three image controls (Image1, Image2, Image3) Assign a small BITMAP for each Image Control in its picture property. IMPORTANT: You need to create a Menu, so go to the VB Menu Editor (Ctrl+E) and create a main menu. Then create 3 Sub Menus. It doesn't matter what you name any of the menus or menu options because this code does the work for you. Copy and paste the API into a Module (Module1) Copy and paste the rest of the code into the form (Form1)

Returns
Places images onto a menu

API Declarations
Declare Function GetMenu Lib "user32" (ByVal hWnd As Long) As Long
Declare Function GetMenuItemID Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpString As Any) As Long
'***Part of the bonus code********************************
Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
'*********************************************************
Global Const MF_BITMAP = 4

Rate Multiple Clickable Bitmaps on a drop menu in a for (100(100 Vote))
Multiple Clickable Bitmaps on a drop menu in a for.bas

Multiple Clickable Bitmaps on a drop menu in a for Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters