Link to home
Start Free TrialLog in
Avatar of dougr
dougr

asked on

Faint VB5 Menu Bar in Win98

I wrote a VB% program containing a menu bar running in Win95.  I upgraded to Win98 and now my menu bar is very faint and hard to read whenever the form in which it resides loses focus.  It switches back to normal dark print when the menu has focus.

Has anyone else experienced this very light grey printing in the menu bar when switching to Win98?  If so, is there a fix?

dougr
ASKER CERTIFIED SOLUTION
Avatar of clifABB
clifABB

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dougr
dougr

ASKER

To: clifABB

My application is set up to have an attractive, full screen Main form as background "wallpaper" with smaller active windows in the foreground.

This Main form is the one with the menu bar on it and at any time the operator can click on a menu item.  Thus I want the menu bar to APPEAR to be active at all times.

With Win95 this was no problem, but in Win98 the lighter color not only is hard to read, but gives the operator the mistaken impression that the menu is NOT enabled, whereas in fact it can be used just by clicking on it in the normal manner.

If this is a change in Win98, is there any work-around or devious way to bypass this feature?  (i.e. superimposing a transparent label over the menu bar to give the appearance of a menu??)

dougr
I don't have Win98 installed here at work so I can't test this, however you may be able to modify the disabled menu color.
Also, you do have a good idea with the transparent label the only problem is you can't overlay the menu bar with a control.  This does give me an idea, though.  Create a "phoney" menu bar (with a picturebox and labels) and use the pop-up menu feature in VB.  That way you don't have to re-create your whole menu structure.
Avatar of dougr

ASKER

To: clifABB

That was an extremely fast response to my comment!

The "phoney" menu with popups sounds like it would work, but the coding would be a real pain - to get the popups to align correctly and all the extra labels required (I have about 10 Main Menu categories).

If there is a way to change the menu colors in one fell swoop by code, it would be simplest and best.  However I would want the change to affect just my own VB5 application and not impinge on the color scheme for the user's entire system.

Perhaps it is just one of those things in Win98 we cannot change and must accept the "Wisdom of Gates"!

However if you don't mind, I will leave the question open for a day or two for additional comments before I award the points.

Thanks for your good response.

dougr
No problem.

In case you decide to go with the phoney menu, it's not as difficult as you might think.  Here's a quick explaination on how it's done:
(When I refer to top level menus, I'm referring to items like the "File", "Edit", "View" on the VB menu.

Add a Picture box to your main form.
Add Label controls to the picture box, the caption of each being the same as the top level menu items.
Name the labels as a control array (in the example, I name them lblMenu(0) through lblMenu(9)).
Set the visible property = False for all the top level menu items.
Make sure all the top menu items are an control array (in the example, I name them mnuMenu(0) through mnuMenu(9)).

Add the following code to the labels' MouseDown event.
Private Sub lblMenu_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)

  If Button = vbLeftButton Then
    PopupMenu mnuMenu(Index), vbPopupMenuLeftAlign, lblMenu(Index).Left, lblMenu(Index).Height
  End If
End Sub

Avatar of dougr

ASKER

To: clifABB

Your answer sounds good.  Thanks for the code.  I have not had time to test it yet, but unless I get some other comment about a simpler fix, I will try the phoney menu method as you proposed.

This is not a big problem with my client yet as they are still running Win95.  However I can anticipate them screaming when they switch to Win98!

dougr