Possible Duplicate:
how to add icon to context menu in c# windows form application
i’ve got a context menu attached to a task tray application. The code is as follows.
private NotifyIcon trayIcon;
private ContextMenu trayMenu;
trayMenu = new ContextMenu();
trayMenu.MenuItems.Add("Login", OnLogin);
trayMenu.MenuItems.Add("LogOut", OnLogOut);
trayIcon = new NotifyIcon();
The problem is that I can’t really seem to find any properties to set an image/icon to each menuitem. Is this possible to do? Any help would be greatly appreciated.
I think that you can add images within
ContextMenuStripbut it’s not possible to do this withContextMenu. Here’s a simple example on how to do thisExample
Notice: When you are ready to show your
NotifyIconto the user, you may useNotifyIcon.Visible = true;Thanks,
I hope you find this helpful 🙂