static void Main(string[] cmd_line) { if (SingleInstanceHelper.GlobalShowWindow(FormMain.TITLE)) { return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { UpdateDependencies(); UpdateMessageIconType(); Application.Run(new FormMain(cmd_line)); } catch (Exception err) { Debug.WriteLine(err); } finally { } }
private void UpdateMenu(ToolStripDropDown menu, ComboBox cmb) { menu.Items.Clear(); foreach (string fileName in _files) { ToolStripMenuItem item = new ToolStripMenuItem(fileName); item.Click += (s, e) => { cmb.Text = item.Text; SingleInstanceHelper.GlobalShowWindow(FormMain.TITLE); }; menu.Items.Add(item); } }
private void m_mnuShow_Click(object sender, EventArgs e) { this.Visible = true; SingleInstanceHelper.GlobalShowWindow(TITLE); }