¿Cómo agregar un icono a System.Windows.Forms.MenuItem?
Intenté agregar un icono a uno de mis elementos del menú contextual, pero no pude hacerlo. Alguien puede ayudarme?
Aquí está el código que he escrito:
private System.Windows.Forms.ContextMenu notifyContextMenu;
private void foo() {
if (notifyIcon == null) {
notifyIcon = new System.Windows.Forms.NotifyIcon();
}
if (notifyContextMenu == null) {
notifyContextMenu = new System.Windows.Forms.ContextMenu();
notifyContextMenu.MenuItems.Add("Exit");
// How do I add an icon to this context menu item?
}
notifyIcon.ContextMenu = notifyContextMenu;
}
}