How can use SetMenuItemBitmaps?

  • Thread starter Thread starter Christian Blackburn
  • Start date Start date
C

Christian Blackburn

Hi Gang,
I would like to use SetMenuItemBitmaps or an equivalent in VB 2003. Can
somebody point me in the right direction?
Thanks in Advance,
Christian
 
Hi Herfried,
Is that control freeware or is it 199 (http://dotnetmagic.com/)? Also when
I tried to view the source code for the control none of the files seemed to
be associated with anything on my system. Is the control written in VB
natively or is a C++.NET control that can be used in VB.net?
Thanks,
Christian
 
Hi Herfried your example is considerably better than just updating the
bitmaps. I like that vertical bar running along the tree of menu items and
the setmenuitembitmaps won't do that. I did have to translate the page
using Google:
http://translate.google.com/transla...F-8&newwindow=1&safe=off&prev=/language_tools

Was he saying that his example lacked the "&" or that the custom object
doesn't support it?
Thanks for helping me yet again,
Christian Blackburn
 
Haven't tried on Win2K but it should work. The menuItems should have a
SidebarColor property which is set to SystemColors.Control by default. The
menuItems BackColor property is set to SystemColors.Menu by default and so
it is possible that these are both the same on your system. Unfortunately,
you must change the properties on each menuitem.

In the property browser are the menuItems shown as ODMenus2002.ODMenuItem?
 
Hi Mick,
Whose control is that ODMenus object? Did you make that or is it commercial
or freeware? Who should I list as the maker in my Help\About page?
Thanks in Advance,
Christian Blackburn
 
Hi Mick,
Sorry I can see that the menu class is yours. Great job by the way. I just
wish it was easier to set the highlight and sidebar colors. It'd be great if
it could be set once and work for all of them. I realize I could probably
do a find and replace on my project :). Also in VB2003 when you mouse over
"File" or one of the other parent menu items it puts a box behind File.
This gives an excellent appearance and makes the menu item look like folder.
Do you have any idea how to do that? It'd be bloody awesome if your control
did it? By the way I'll be sure to credit your menu bar in my help about
dialog.
Cheers,
Christian Blackburn
 
Hey Mick,
Heads up your mail box is full:
-------------------------------------------------------------------------
This Message was undeliverable due to the following reason:

The user(s) account is temporarily over quota.

<[email protected]>

Please reply to (e-mail address removed)
if you feel this message to be in error.
 
Yes, I just got back from Holiday and found over 200 MS Update(Virus)
messages along with the usual Enlargement and XXX spam messages. Thats all
been cleared now.
 
OK, an easy way to set all the ODMenuItems Highlight and Sidebar colors is
to simply change the default colors in the MenuClass. This only has to be
done once to affect all instances of that class. As for the Box, look at the
HiLiteBorderColor property.

I would really like to create a Custom Menu Designer but the MainMenu and
ContextMenu classes have been sealed, and MenuDesigner is Private within the
Framework. This is why I never created a MenuControl, far too much work even
if I knew where to begin.
 
Hi Mick,
Sorry to hear about all the MS wannabe updates. There sure are a hell of a
lot of people faking MS lately, I'm sure it has a higher success rate than
anything else they've ever tried. Let's face it people trust MS and that
trust is bound to be exploited :). Over and over and over again :). I've
been getting heaping helping of those e-mails too. Thanks for the help on
making settings "more" permanent and global for the menu bar properties. I
am still however wondering how and or why your menu bar isn't able to
emulate the appearance of Visual Studio's?
http://www.rawsacramento.org/~christian/misc/ODMenus Question.png.
Cheers,
Christian Blackburn
 
The reason that the Menu looks different is that I have no control over the
MenuStyle. The difference you are seeing is not a difference in the Menu
Items(OK there is a slight difference), but a difference in the Menu
Border(Non Client Area). The MenuItem Class only draws the Client Area. To
get the FlatStyle Appearance with Shadow you need to Override the MainMenu
Class NCPaint events and draw the style there. This is not an easy Task as
the MainMenu and ContextMenu classes have been sealed and do not expose
these events. I think you should be able to achieve this through
subclassing, but it will very likely be a lot of work. I may look into this
when I get time.
 
look at codejock software, they have a bitchin' component for menus, puts
microsofts to shame


what I always wonder about this company, and the guy from vbaccelerator.com

did some of this code sneak out the back door at MS? it's too perfect, great
stuff, but too perfect.......



thanks -J
 
Well That is one way to get a Menu Designer, although the TopLevel Menus are
really Toolbar Buttons, the appearance is the same so long as you Lock the
MenuToolbar. Maybe I'll write one of those.
I havent tried that component as I prefer to write my own controls, besides
which, I am only a Hobby programmer so do not wish to pay for 3rd party
controls. Does this component provide an option for Flatstyle Menus in OS's
other than XP?
 
Hi Mick,
Thanks for getting back to me. So if I understand you correctly every
feature you're class now provides is really just accessing properties of the
windows API and is not adding any additional functionality to the API, just
VB. If I understand it correctly SubClassing is where a programmer can add
to the functionality of Windows thereby inventing new objects and behaviors.
So a subclassed feature would presumably be more error prone as it wouldn't
have tested and used for years and years like most of the Windows API. If
you do ever update your class please post a notice to the group so we can
optionally update any projects that use it :).
Thanks again for your cool ODMenus Class.
Adios Amigo,
Christian Blackburn



Mick Doherty said:
The reason that the Menu looks different is that I have no control over the
MenuStyle. The difference you are seeing is not a difference in the Menu
Items(OK there is a slight difference), but a difference in the Menu
Border(Non Client Area). The MenuItem Class only draws the Client Area. To
get the FlatStyle Appearance with Shadow you need to Override the MainMenu
Class NCPaint events and draw the style there. This is not an easy Task as
the MainMenu and ContextMenu classes have been sealed and do not expose
these events. I think you should be able to achieve this through
subclassing, but it will very likely be a lot of work. I may look into this
when I get time.

Christian Blackburn said:
Hi Mick,
Sorry to hear about all the MS wannabe updates. There sure are a hell
of
a
lot of people faking MS lately, I'm sure it has a higher success rate than
anything else they've ever tried. Let's face it people trust MS and that
trust is bound to be exploited :). Over and over and over again :). I've
been getting heaping helping of those e-mails too. Thanks for the help on
making settings "more" permanent and global for the menu bar properties. I
am still however wondering how and or why your menu bar isn't able to
emulate the appearance of Visual Studio's?
http://www.rawsacramento.org/~christian/misc/ODMenus Question.png.
Cheers,
Christian Blackburn
 
My class adds nothing other than a modified appearance and some properties
for easy manipulation of that appearance along with Height/Width properties.

Subclassing gives us access to Messages and Structures which have been sent
to the OS, but for which no interface has been supplied. We can Intercept
and modify, or discard these messages and structures, but if not handled
correctly this will cause GPF's.

I am not likely to update the class, unless someone spots a missing feature
that I feel would be beneficial which could be easily added. Well actually
the current version I have on my PC has some extra attributes that cut down
on the Serialization Code generated by DotNet, but that doesn't really
provide any benefit to the finished project. If I work out how, I may create
a Menu Control that uses it, but that's not likely to be anytime soon.

Glad you liked it.

Mick

Christian Blackburn said:
Hi Mick,
Thanks for getting back to me. So if I understand you correctly every
feature you're class now provides is really just accessing properties of the
windows API and is not adding any additional functionality to the API, just
VB. If I understand it correctly SubClassing is where a programmer can add
to the functionality of Windows thereby inventing new objects and behaviors.
So a subclassed feature would presumably be more error prone as it wouldn't
have tested and used for years and years like most of the Windows API. If
you do ever update your class please post a notice to the group so we can
optionally update any projects that use it :).
Thanks again for your cool ODMenus Class.
Adios Amigo,
Christian Blackburn



Mick Doherty said:
The reason that the Menu looks different is that I have no control over the
MenuStyle. The difference you are seeing is not a difference in the Menu
Items(OK there is a slight difference), but a difference in the Menu
Border(Non Client Area). The MenuItem Class only draws the Client Area. To
get the FlatStyle Appearance with Shadow you need to Override the MainMenu
Class NCPaint events and draw the style there. This is not an easy Task as
the MainMenu and ContextMenu classes have been sealed and do not expose
these events. I think you should be able to achieve this through
subclassing, but it will very likely be a lot of work. I may look into this
when I get time.

message news:%[email protected]... of
help
 
Back
Top