Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to associate icons with menu items

0 views
Skip to first unread message

Joyce Liu

unread,
Jul 29, 2003, 12:50:46 PM7/29/03
to
Does anyone know a quick and easy way to place icon images in menu items of
a MainMenu control? This is usually an effortless task for other controls
using their ImageList properties, which is not available for MainMenu. The
only way I can find is to set the menu item's OwnerDraw property to true and
write code to handle the MeasureItem and DrawItem events.

TIA for any input.

Joyce Liu


Tim Wilson [MVP]

unread,
Jul 29, 2003, 1:11:33 PM7/29/03
to
Like you said, you can owner draw the menu items. Other than that I think
that you will need to pursue other options like the magic library:
http://www.dotnetmagic.com

--
Tim Wilson
Windows Embedded MVP

"Joyce Liu" <joyc...@unisys.com> wrote in message
news:uOIfPGfV...@tk2msftngp13.phx.gbl...

Herfried K. Wagner

unread,
Jul 29, 2003, 1:27:23 PM7/29/03
to
Hello,

"Joyce Liu" <joyc...@unisys.com> schrieb:

Outlook Express style:

http://www.aisto.com/roeder/dotnet/
-> "CommandBar for .NET"

VS .NET style menu:

http://www.dotnetmagic.com/

VS .NET style toolbar:

http://www.codeproject.com/cs/menu/vsnettoolbar.asp

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet


Jerry Ham

unread,
Jul 29, 2003, 7:57:26 PM7/29/03
to
If you do choose to owner draw them (which works), you are in for a surprise
if you try to owner draw a popup menu from a tray icon. The owner draw of
the icon won't seem to work there (at least in 1.0 of the framework). I had
it working fine like you mention with the MeasureItem, DrawItem and all from
the mainmenu. But then, do the same thing with a popup from a trayicon and I
could never make it work...

Jerry

"Joyce Liu" <joyc...@unisys.com> wrote in message
news:uOIfPGfV...@tk2msftngp13.phx.gbl...

Dion Heskett

unread,
Jul 30, 2003, 5:13:01 AM7/30/03
to

Sundar

unread,
Aug 15, 2003, 11:28:45 AM8/15/03
to
Hi,

Give this control a try -
http://www.binarymission.co.uk/binarymenuitem.aspx
It could be of help!

"Dion Heskett" <dhon...@llewellyn.co.uk> wrote in message
news:uNxPGrnV...@tk2msftngp13.phx.gbl...

Slonjo

unread,
Aug 18, 2003, 1:46:17 PM8/18/03
to
I am trying the context menu from the NotifyIcon also. No luck. The
menu background draws and any non-IconMenuItems I have in it but the
custom menu item's 'OnDrawItem' never fires.

The .NET context menu concept differs from the old 'popup' menu in
that you now have to assign the menu to a control to show it. Why did
they have to go and do that instead of just letting us assign a screen
position for it to 'appear'?

0 new messages