private void p2_Click(object sender, EventArgs e) { Panel p = (Panel)sender; bool ok = false; for (int i = 0; i < p.Controls.Count; i++) { if (p.Controls[i].Name.Substring(0, 1) == "l") { if (p.Controls[i].Text == searchmaths.SearchProp.rep) { ok = true; p.BackColor = Color.Green; } } } if (p1 != p) { p1.BackColor = Color.DimGray; l1.Text = ""; } if (p2 != p) { p2.BackColor = Color.DimGray; l2.Text = ""; } if (p3 != p) { p3.BackColor = Color.DimGray; l3.Text = ""; } if (p4 != p) { p4.BackColor = Color.DimGray; l4.Text = ""; } counter++; if (ok == true) { correct++; } else { p.BackColor = Color.Red; } if ((counter == 5) && (correct > 2)) { pTermineniv.Show(); pTermineniv.BringToFront(); if (searchmaths.SearchProp.niveau == "1") { lniv1termine.Show(); Continue.Show(); Continue.Text = "Niveau2"; } else if (searchmaths.SearchProp.niveau == "2") { lniv1termine.Hide(); lniv2termine.Show(); Continue.Hide(); } } else { Suivant.Show(); } }
/// <summary> /// Metoda RefreshMenu obnovuje Form1 a zobrazí tlačítko "Pokračovat", pokud zjistí přítomnost uložené hry. /// </summary> public void RefreshMenu() { if (File.Exists("./lehka/pokracovani.txt")) { AlreadyLoaded = false; Continue.Show(); Continue.Click += new EventHandler(Continue_Click); } else { Continue.Hide(); } }