VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Bobo Bitmap Menus Simplified

by MrBobo (49 Submissions)
Category: VB function enhancement
Compatability: Visual Basic 5.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (20 Votes)

There are quite a few submissions on VBC demonstrating the use of ownerdrawn menus. Most are very good, I voted for them ! However, for some folks they were a bit complex and hard to understand. I hope this helps clarify the process for less experienced coders. Most professional VB programmers have been doing this for years. This submission seeks to simplify, as much as possible, the process of converting VB menus to ownerdrawn menus. No side panels, crazy fonts/colors - just the default menu with a true color icon. This small module is a cut-down version of a template I wrote a long, long time ago. I hope I haven't introduced too many bugs in the process of simplifying it, but if I have they shouldn't be too major and the concepts involved are still well demonstrated.
The tasks :
1. Locate all VBmenus on a form and determine thier actual handle according to Windows
2. Change the type of each menu to 'Ownerdrawn'
3. Subclass the form so we can respond to the messages 'WM_MEASUREITEM' and 'WM_DRAWITEM'
4. Use the API to print a caption and paint an icon, either Enabled/Disabled or Checked, in response to those messages.

Rate Bobo Bitmap Menus Simplified

Download Bobo Bitmap Menus Simplified

Download Bobo Bitmap Menus Simplified (11 KB)

Bobo Bitmap Menus Simplified Comments

No comments have been posted about Bobo Bitmap Menus Simplified. Why not be the first to post a comment about Bobo Bitmap Menus Simplified.

Post your comment

Subject:
Message:
0/1000 characters