Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Is there a way to change the color of the main menu bar? In my program, I give the user the option of changing the colors of the form, and it doesn't look right when the main menu bar stays gray.
Take a look at my programs. Go to my web site.
  • *Experts*
Posted
You need to Ownerdraw the menu items and draw them manually. Look in the Code Library for my "Extend your Menus With IExtenderProvider" component. You can modify the source to suit your needs.
  • *Experts*
Posted

That's just an example of owner-drawing menu items. As it is, when you put the component on your form, it extends every menu on the form which an ImageIndex property (you need to specify and ImageList in the MenuIconProvider component itself first), and then it will draw the image next to the menu item like it does in MS Office 2000.

 

For what you want, you may not need the Image functionality, but you can modify the source of the component to change the background color. If I remember correctly, I commented the source code so you can find the code which does that. There's a block of code which checks if the item is selected and sets the color to either SystemColors.Control or SystemColors.Highlight, and you can change those two to whatever you want. You get full drawing control, so you can do whatever you need.

Posted
Whew, I think I'm in over my head. I don't know enough about VB yet to do all of this stuff, so I think I'll just leave the menu color the way it is. Thanks for your help, though.
Take a look at my programs. Go to my web site.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...