Home   .......

Owner Drawn Menu Tutorial

Let's Start Off

Products  
eXamples  
Files  
e-Mail Us  
 

 

Ok, let's start off...

What we need before we start is:

1. Images of all menu items (for the selected outlook of the menu items we use ready-made images, but instead of different images for selected menus, any other indication may be used - like inverting the image, drawing a rectangle around or else). These images are stored in simple picture boxes. Note that as these picture boxes are hidden at run-time, it is very important that they have their AutoRedraw property set to True*.

2. A main menu and some submenus created. These menus are created by Visual Basic, we will modify the File menu later on.

3. We must have subclassed** our main window, so that we will receive all messages sent from Windows to our form. This way, we will be notified by Windows when our menu needs to be drawn.

4. A module with the declarations of all API functions, constants and types we are going to use.

*AutoRedraw tells VB that picture's hDC property (that we are going to use) will contain the actual image, rather than what is shown on screen.

** Subclassing is explained in Using Window API in VB Tutorial available online (vboffbeat.cjb.net)

 
Copyright (c) 1999, Billy&George Software and Peter Dimitrov
Revised May 1999