private void label4_Click(object sender, EventArgs e) { this.Visible = false; using (Options o = new Options()) o.ShowDialog(); this.Visible = true; }
private void MainMenu_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) { if (labelindex == 0) { Program.startgame = true; this.Close(); } if (labelindex == 1) { using (Process proc = Process.Start(start)) { proc.WaitForExit(); } } if (labelindex == 2) { this.Visible = false; using (Options o = new Options()) o.ShowDialog(); this.Visible = true; } if (labelindex == 3) { this.Close(); } } if (e.KeyData == Keys.N ) { Program.startgame = true; this.Close(); } if (e.KeyData == Keys.Escape || e.KeyData == Keys.E) { this.Close(); } if (e.KeyData == Keys.O) { this.Visible = false; using (Options o = new Options()) o.ShowDialog(); this.Visible = true; } if (e.KeyData == Keys.Up) { if (labelindex > 0) { ChangeLabelIndex("+"); } } if (e.KeyData == Keys.Down) { if (labelindex != buttonlist.Count - 1) { ChangeLabelIndex("-"); } } }