Reputation: 823
I've a WPF application, in which I use a notification icon with the use Forms. I need to have a context menu for this notification icon, where each menu item got to have image property as well along with the header.
Upvotes: 0
Views: 3598
Reputation: 612954
I know it's a WinForms component rather than a WPF component but you can still use NotifyIcon
in WPF. Set the ContextMenu
or ContextMenuStrip
properties to assign a menu to the icon.
EDIT: Judging by your comments and answer I believe that you are trying to use MenuItem
which does not have built-in support for displaying images. However, that deficiency was long ago removed with the introduction of ToolStripMenuItem
. This has an Image
property, or alternatively the ImageIndex
property is you prefer to use image lists.
Upvotes: 3
Reputation: 823
Finally I could find what I wanted. You need to enable OwnerDraw property of the Forms Menu and write two events part of it. Here is the link to the url:
http://www.codeproject.com/KB/menus/cs_menus.aspx
Upvotes: 0