private void button1_Click(object sender, EventArgs e) { if (score < 3) { if (textBox1.Text == CheckWichClock(clock)) { score += 10; scoretxt.Text = "Score: " + score.ToString(); Faux.Visible = false; Random ri = new Random(); int ai = ri.Next(0, 20); clock.Image = imageList1.Images[ai]; clock.Image.Tag = ai; textBox1.Clear(); } else { Faux.Visible = true; } } else { niveau++; dr[0]["Clock"] = niveau + 1; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); score = 0; } }
void Restart() { if ((int.Parse(dr[0]["Suitenb"].ToString()) > t) && (BeePic.Bounds.IntersectsWith(PicBeehive.Bounds))) { dr[0]["Suitenb"] = t; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); label3.Text = "meilleur temps : " + dr[0]["Suitenb"] + " s"; } redbtn = 0; lblLost.Visible = false; lblWin.Visible = false; BeePic.Location = new Point(50, 40); var btnsVrai = new List <Button> { btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9, btn10, btn11, btn12 }; var btnsFaux = new List <Button> { button1, button23, button3, button4, button5, button6, button7, button8, button10, button11, button15, button16, button17, button19, button20, button21, button26, button27, button28, button32, button33, button34, button36 }; for (int i = 0; i < 12; i++) { btnsVrai[i].BackColor = Color.SpringGreen; } for (int i = 0; i < 22; i++) { btnsFaux[i].BackColor = Color.SpringGreen; btnsFaux[i].Tag = ""; } t = 0; TimeShow.Text = "0 s"; timershow(); }
private void pictureBox2_Click(object sender, EventArgs e) { for (int i = 0; i < 5; i++) { scoreTotal1 += scores[i]; } for (int i = 0; i < 5; i++) { scoreTotal2 += scores[i]; } if (scoreTotal1 > int.Parse(dr[0]["SingulierOuPluriel"].ToString())) { dr[0]["SingulierOuPluriel"] = scoreTotal1; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } if (scoreTotal2 > int.Parse(dr[0]["Grammaire21"].ToString())) { dr[0]["Grammaire21"] = scoreTotal2; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } this.Close(); Variables.matiere.ShowInTaskbar = true; Variables.matiere.Show(); }
private void pictureBox3_Click(object sender, EventArgs e) { dr = Variables.XmlReader(Application.StartupPath + "\\users.xml"); dr[0]["orthographe"] = score; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); this.Close(); hom.Show(); }
private void commencer1_Click(object sender, EventArgs e) { if (reponses < 10) { foreach (Control c in groupBox1.Controls) { RadioButton b = (RadioButton)c; if (b.Checked) { choisi = b; } } if (choisi.Text == trueanswr) { score += 5; lblarr[reponses].BackColor = Color.Green; } else { lblarr[reponses].BackColor = Color.Red; //AddTrue sounds else add false sounds } reponses++; NewConj(); } else { DialogResult rep = MessageBox.Show(score / 5 + @" Reponses Exactes. Voulez vous continuer?", "Courage", MessageBoxButtons.YesNo, MessageBoxIcon.None); if (rep == DialogResult.Yes) { foreach (RoundButton r in lblarr) { r.BackColor = Color.Transparent; } reponses = 0; score = 0; NewConj(); } else { panel1.Visible = true; panel2.Visible = false; foreach (RoundButton r in lblarr) { r.BackColor = Color.Transparent; } if (!conj2) { if ((int.Parse(dr[0]["conjugaison1"].ToString())) < score) { dr[0]["conjugaison1"] = score; } Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } else { if ((int.Parse(dr[0]["conjugaison2"].ToString())) < score) { dr[0]["conjugaison2"] = score; } Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } } } }
private void btnExit_Click(object sender, EventArgs e) { if (int.Parse(dr[0]["Clock"].ToString()) < score) { dr[0]["Clock"] = score; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } Application.Exit(); }
private void pictureBox3_Click(object sender, EventArgs e) { if (int.Parse(dr[0]["PlusMoins"].ToString()) < score) { dr[0]["PlusMoins"] = score; } Variables.XmlWriter(Application.StartupPath + "\\users.xml"); Application.Exit(); }
private void pictureBox2_Click(object sender, EventArgs e)//reponse { PictureBox p = (PictureBox)sender; int q = p.ImageLocation.LastIndexOf("\\"), q1 = s[k + 1].LastIndexOf("\\"); string t = p.ImageLocation.Remove(0, q + 2), t1 = s[k + 1].Remove(0, q1 + 1); q = t.LastIndexOf("."); q1 = t1.LastIndexOf("."); t = t.Remove(q, 4); t1 = t1.Remove(q1, 4); t1 = PhotoLettresConnaissance(t1); if (t == t1) { label9.Visible = false; c++; k = k + 2; if (c >= 10) { w = c + z; dr[0]["Prononciation"] = w; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); pictureBox1.Visible = false; pictureBox2.Visible = false; pictureBox3.Visible = false; pictureBox4.Visible = false; pictureBox5.Visible = false; pictureBox6.Visible = false; label2.Visible = false; button2.Visible = false; button1.Visible = ou.Visible = true; label8.Visible = true; label11.Visible = true; button3.Visible = true; label8.Text = w + " / 10"; } else { s1 = RandomPhotoLettresConnaissance(c); pictureBox1.ImageLocation = s[k + 1]; p1.URL = s[k]; pictureBox2.ImageLocation = s1[0]; pictureBox3.ImageLocation = s1[1]; pictureBox4.ImageLocation = s1[2]; pictureBox5.ImageLocation = s1[3]; pictureBox6.ImageLocation = s1[4]; int c1 = 0; for (int i = 0; i < s1.Length; i++) { if (s1[i] == null) { c1++; } } if (c1 == 1) { pictureBox6.Visible = false; } else if (c1 == 2) { pictureBox6.Visible = false; pictureBox5.Visible = false; } else { pictureBox5.Visible = true; pictureBox6.Visible = true; } } } else { label9.Visible = true; z--; } }
private void btnExit_Click(object sender, EventArgs e) { if (int.Parse(dr[0]["Perim"].ToString()) < score) { dr[0]["Perim"] = score; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } CryptageEtHachage.HashXmlUsers(Variables.UserNom, Variables.UserPass, Application.StartupPath + "\\users.xml"); Application.Exit(); }
private void pictureBox2_Click(object sender, EventArgs e) { if ((int.Parse(dr[0]["Suitenb"].ToString()) > t) && BeePic.Bounds.IntersectsWith(PicBeehive.Bounds)) { dr[0]["Suitenb"] = t; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } this.Close(); Variables.matiere.Show(); Variables.matiere.ShowInTaskbar = true; }
private void pictureBox3_Click(object sender, EventArgs e) { if ((int.Parse(dr[0]["Suitenb"].ToString()) > t) && (BeePic.Bounds.IntersectsWith(PicBeehive.Bounds))) { dr[0]["Suitenb"] = t; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } Application.Exit(); CryptageEtHachage.HashXmlUsers(Variables.UserNom, Variables.UserPass, Application.StartupPath + "\\users.xml"); }
private void picBack_Click(object sender, EventArgs e) { dr = Variables.XmlReader(Application.StartupPath + "\\users.xml"); if (int.Parse(dr[0]["Ecriture"].ToString()) < acquis) { dr[0]["Ecriture"] = acquis; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } this.Close(); Variables.matiere.Show(); Variables.matiere.ShowInTaskbar = true; }
private void pictureBox1_Click(object sender, EventArgs e) { if (int.Parse(dr[0]["Clock"].ToString()) < score) { dr[0]["Clock"] = score; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } this.Close(); Variables.matiere.Show(); Variables.matiere.ShowInTaskbar = true; }
private void btnBack_Click(object sender, EventArgs e) { if (int.Parse(dr[0]["FlappyBird"].ToString()) < Score) { dr[0]["FlappyBird"] = Score; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } this.Close(); Variables.Jeux.Show(); Variables.Jeux.ShowInTaskbar = true; }
public void pictureBox1_Click(object sender, EventArgs e) { dic1.texts(); if (a == 1) { { for (int i = 0; i < Repponses.Length; i++) { remarques += i + ")" + test(dic1.Texte[i], Repponses[i], out float Current) + "\n";//dic1.vn.URL = @"Voix/Dic" + t[i] + 1; noteLevel += Current; } { string message; if (noteLevel > 22) { message = "Ton Note est" + noteLevel.ToString() + "/50 .\n Courage Champ! \n Voulez vous repeter?"; DialogResult rep = MessageBox.Show(message, "Dictee", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (rep == DialogResult.Yes) { dic1.newEx(); remarques = ""; noteLevel = 0; Repponses = Reponses(); } else { this.Close(); } } else { message = "Ton Note est" + noteLevel.ToString() + "/50 . \n :( Ressayer"; MessageBox.Show(message + remarques); Repponses = Reponses(); dic1.newEx(); remarques = ""; noteLevel = 0; } // if (noteLevel > 0) { a++; dic1.Dispose(); dic2.Visible = true; noteLevel = 0; remarques = null; return; } } } //{ if (dic1.Texte[i] == Reponses(a)[i]) { score += 20; MessageBox.Show(score.ToString()); dic1.Dispose(); dic2.Visible = true; } else { dic1.Controls[i].BackColor = Color.Red; } } } } //else if (a == 2) //{ // { for (int i = 0; i < Reponses(a).Length; i++) { remarques += i + 1 + ")" + test(dic2.Texte[i], Reponses(a)[i], out float Current) + "\n"; noteLevel += Current; } { string message; if (noteLevel > 0) message = "Ton Note est" + noteLevel.ToString() + ".\n Courage Champ!"; else message = "Ton Note est" + noteLevel.ToString() + ". \n :( Ressayer"; MessageBox.Show(message + remarques); if (noteLevel > 10) { a++; remarques = null; dic2.Dispose(); dic3.Visible = true; return; } } }//{ if (dic2.Texte[i] == Reponses(a)[i]) { score += 30; MessageBox.Show(score.ToString()); dic2.Dispose(); dic3.Visible = true; } else { dic1.Controls[i].BackColor = Color.Red; } } } //} //else if (a == 3) //{ // for (int i = 0; i < Reponses(a).Length; i++) { remarques += i + 1 + ")" + test(dic3.Texte[i], Reponses(a)[i], out float Current); noteLevel = Current * 2; } // if (dic3.Texte[i] == Reponses(a)[i]) { score += 20; MessageBox.Show(score.ToString()); this.Close(); } // if (noteLevel > 0) { a++; score = 0; } else MessageBox.Show("Ressayer."); //} //else if (a == 4) { MessageBox.Show("Ton Note est" + noteLevel.ToString() + "Courage!"); this.Close(); } } dr = Variables.XmlReader(Application.StartupPath + "\\users.xml"); if (int.Parse(dr[0]["Dictee"].ToString()) < noteLevel) { dr[0]["Dictee"] = noteLevel; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } }
private void btnRestart_Click(object sender, EventArgs e) { if (int.Parse(dr[0]["FlappyBird"].ToString()) < Score) { dr[0]["FlappyBird"] = Score; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } scoreText.Location = new Point(65, 20); debut = 1; Score = 0; btnRestart.Visible = false; pipeTop.Location = new Point(590, 9); pipeBottom.Location = new Point(460, 500); flappyBird.Location = new Point(75, 360); ground.Location = new Point(0, 630); ground.BringToFront(); ground.Visible = true; gameTimer.Start(); }
private void BtnNext_Click(object sender, EventArgs e) { dr = Variables.XmlReader(Application.StartupPath + "\\users.xml"); if (Variables.counter > 2) { Variables.counter = 2; } Variables.counter = Variables.counter + 1; if (Variables.counter == 1) { if (Variables.MatiereNomPublic == "MT") { lvlFrancais.Visible = false; lvlMaths.Visible = true; if (int.Parse(dr[0]["Nombres"].ToString()) + int.Parse(dr[0]["Suitenb"].ToString()) + int.Parse(dr[0]["Comparaison"].ToString()) + int.Parse(dr[0]["PlusMoins"].ToString()) < 250) { lockmt1.Visible = lockmt2.Visible = lockmt3.Visible = lockmt4.Visible = true; PicmtEX1.Enabled = PicmtEX2.Enabled = PicmtEX3.Enabled = PicmtCours4.Enabled = PicmtEX4.Enabled = PicmtCours1.Enabled = PicmtCours2.Enabled = PicmtCours3.Enabled = false; } else { lockmt1.Visible = lockmt2.Visible = lockmt3.Visible = lockmt4.Visible = false; lvlMaths.Image = Properties.Resources.crown2; PicmtEX1.Enabled = PicmtEX2.Enabled = PicmtEX3.Enabled = PicmtCours4.Enabled = PicmtEX4.Enabled = PicmtCours1.Enabled = PicmtCours2.Enabled = PicmtCours3.Enabled = true; if (Variables.levelmt == 1) { Variables.levelmt = 2; dr[0]["lvlmt"] = 2; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } } PanelMaths.Visible = true; PanelFrancais.Visible = false; toolTip1.SetToolTip(Picmt1, "Foix et divisé"); toolTip1.SetToolTip(Picmt2, "Les formes géométeriques"); toolTip1.SetToolTip(Picmt3, "Double et moitié"); toolTip1.SetToolTip(Picmt4, "Fraction"); lbl.Text = "Intermediaire"; Picmt1.Name = "Picmt5"; Picmt2.Name = "Picmt6"; Picmt3.Name = "Picmt7"; Picmt4.Name = "Picmt8"; for (int i = 5; i < 9; i++) { Image image = Image.FromFile(Application.StartupPath + "\\Pics\\mathsLvl" + i + ".png"); PanelMaths.Controls["Picmt" + i.ToString()].BackgroundImage = image; PanelMaths.Controls["Picmt" + i.ToString()].BackgroundImageLayout = ImageLayout.Stretch; } } else if (Variables.MatiereNomPublic == "FR") { lvlMaths.Visible = false; lvlFrancais.Visible = true; PanelMaths.Visible = false; PanelFrancais.Visible = true; if (int.Parse(dr[0]["prononciation"].ToString()) + int.Parse(dr[0]["Ecriture"].ToString()) < 2) { lock1.Visible = lock2.Visible = lock3.Visible = true; lvlFrancais.Image = Properties.Resources.crown2; PicfrEX1.Enabled = PicfrEX2.Enabled = PicfrEX3.Enabled = PicfrCours1.Enabled = PicfrCours2.Enabled = PicfrCours3.Enabled = false; } else { lock1.Visible = lock2.Visible = lock3.Visible = false; lvlFrancais.Image = Properties.Resources.crown2; PicfrEX1.Enabled = PicfrEX2.Enabled = PicfrEX3.Enabled = PicfrCours1.Enabled = PicfrCours2.Enabled = PicfrCours3.Enabled = true; if (Variables.levelfr == 1) { Variables.levelfr = 2; dr[0]["lvlfr"] = 2; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } } Picfr3.Visible = true; PicfrCours3.Visible = true; PicfrEX3.Visible = true; PicfrCours1.Visible = true; toolTip1.SetToolTip(Picfr1, "Orthographe"); toolTip1.SetToolTip(Picfr2, "Grammaire 1"); toolTip1.SetToolTip(Picfr3, "Conjugaison 1"); //Picfr3.Name = "Picfr5"; Picfr1.Name = "Picfr3"; Picfr2.Name = "Picfr4"; Picfr3.Name = "Picfr5"; lbl.Text = "Intermediaire"; for (int i = 3; i < 6; i++) { Image image = Image.FromFile(Application.StartupPath + "\\Pics\\frns" + i + ".png"); PanelFrancais.Controls["Picfr" + i.ToString()].BackgroundImage = image; PanelFrancais.Controls["Picfr" + i.ToString()].BackgroundImageLayout = ImageLayout.Stretch; } } } else if (Variables.counter == 2) { if (Variables.MatiereNomPublic == "MT") { if (int.Parse(dr[0]["MultiDiv"].ToString()) + int.Parse(dr[0]["FormesGeo"].ToString()) + int.Parse(dr[0]["MoitieEtDouble"].ToString()) + int.Parse(dr[0]["Fractions"].ToString()) < 250) { lockmt1.Visible = lockmt2.Visible = lockmt3.Visible = lockmt4.Visible = lockmt5.Visible = true; PicmtEX1.Enabled = PicmtEX2.Enabled = PicmtEX3.Enabled = PicmtCours4.Enabled = PicmtEX4.Enabled = PicmtEX5.Enabled = PicmtCours5.Enabled = PicmtCours1.Enabled = PicmtCours2.Enabled = PicmtCours3.Enabled = false; } else { lvlMaths.Image = Properties.Resources.crown3; lockmt1.Visible = lockmt2.Visible = lockmt3.Visible = lockmt4.Visible = false; PicmtEX1.Enabled = PicmtEX2.Enabled = PicmtEX3.Enabled = PicmtCours4.Enabled = PicmtEX4.Enabled = PicmtCours1.Enabled = PicmtCours2.Enabled = PicmtCours3.Enabled = true; Variables.levelmt = 3; dr[0]["lvlmt"] = 3; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } PanelMaths.Visible = true; PanelFrancais.Visible = false; toolTip1.SetToolTip(Picmt1, "L'heure"); toolTip1.SetToolTip(Picmt2, "Ordre croissante et décroissante"); toolTip1.SetToolTip(Picmt3, "Périmètre"); toolTip1.SetToolTip(Picmt4, "Complèment à 10"); toolTip1.SetToolTip(Picmt13, "Calcule avec priorité"); Picmt1.Name = "Picmt9"; Picmt2.Name = "Picmt10"; Picmt3.Name = "Picmt11"; Picmt4.Name = "Picmt12"; Picmt13.Visible = true; PicmtCours5.Visible = true; PicmtEX5.Visible = true; lbl.Text = "Champions"; for (int i = 9; i < 14; i++) { Image image = Image.FromFile(Application.StartupPath + "\\Pics\\mathsLvl" + i + ".png"); PanelMaths.Controls["Picmt" + i.ToString()].BackgroundImage = image; PanelMaths.Controls["Picmt" + i.ToString()].BackgroundImageLayout = ImageLayout.Stretch; } } else if (Variables.MatiereNomPublic == "FR") { if (int.Parse(dr[0]["orthographe"].ToString()) + int.Parse(dr[0]["conjugaison1"].ToString()) + int.Parse(dr[0]["SingulierOuPluriel"].ToString()) < 10) { lock1.Visible = lock2.Visible = lock3.Visible = true; PicfrEX1.Enabled = PicfrEX2.Enabled = PicfrEX3.Enabled = PicfrCours1.Enabled = PicfrCours2.Enabled = PicfrCours3.Enabled = false; } else { lock1.Visible = lock2.Visible = lock3.Visible = false; lvlFrancais.Image = Properties.Resources.crown3; PicfrEX1.Enabled = PicfrEX2.Enabled = PicfrEX3.Enabled = PicfrCours1.Enabled = PicfrCours2.Enabled = PicfrCours3.Enabled = true; Variables.levelfr = 3; dr[0]["lvlfr"] = 3; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); } //PanelMaths.Visible = false; //PanelFrancais.Visible = true; toolTip1.SetToolTip(Picfr1, "Dictée"); toolTip1.SetToolTip(Picfr2, "Grammaire 2"); toolTip1.SetToolTip(Picfr3, "Conjugaison 2"); PicfrCours1.Visible = false; Picfr1.Name = "Picfr6"; Picfr2.Name = "Picfr7"; Picfr3.Name = "Picfr8"; lbl.Text = "Champions"; for (int i = 6; i < 9; i++) { Image image = Image.FromFile(Application.StartupPath + "\\Pics\\frns" + i + ".png"); PanelFrancais.Controls["Picfr" + i.ToString()].BackgroundImage = image; PanelFrancais.Controls["Picfr" + i.ToString()].BackgroundImageLayout = ImageLayout.Stretch; } } } }
private void pictureBox1_Click(object sender, EventArgs e) { for (int i = 0; i < 19; i++) { exercices += Variables.exSup[i] + ","; } exercices = exercices.Remove(exercices.LastIndexOf(',')); dr[0]["exSupp"] = exercices; Variables.XmlWriter(Application.StartupPath + "\\users.xml"); this.Close(); Variables.intro.Show(); }