private void ContextMenuAutostart(object sender, EventArgs e) { if (contextMenuAutostartItem.Checked) { Autostart.Disable(); } else { Autostart.Enable(); } contextMenuAutostartItem.Checked = Autostart.IsEnabled(); }
private void CreateContextMenu() { contextMenuAutostartItem = new MenuItem("&Autostart", ContextMenuAutostart) { Checked = Autostart.IsEnabled() }; notifyIcon.ContextMenu = new ContextMenu(new[] { contextMenuAutostartItem, new MenuItem("-"), new MenuItem("&Settings", ContextMenuSettings), new MenuItem("E&xit", ContextMenuExit), }); }