Exemplo n.º 1
0
 private void button7_Click(object sender, EventArgs e)
 {
     if (button1.Text == "Gata")
     {
         if (Class2.Gen == 0)
         {
             if (MessageBox.Show("Ești sigură că vrei să părăsești pagina?", "Date nesalvate", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
             {
                 this.Hide();
                 Form33 f33 = new Form33();
                 f33.Show();
             }
         }
         else if (Class2.Gen == 1)
         {
             if (MessageBox.Show("Ești sigur că vrei să părăsești pagina?", "Date nesalvate", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
             {
                 this.Hide();
                 Form33 f33 = new Form33();
                 f33.Show();
             }
         }
     }
     else if (button1.Text == "Done")
     {
         if (MessageBox.Show("Are you sure you want to go?", "Unsaved data", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
         {
             this.Hide();
             Form33 f33 = new Form33();
             f33.Show();
         }
     }
     else if (button1.Text == "Editează" || button1.Text == "Edit")
     {
         this.Hide();
         Form33 f33 = new Form33();
         f33.Show();
     }
 }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            //verificarea întrebărilor, actualizarea punctajului în cazul răspunsurilor corecte și actuaizarea imaginii din dreptul întrebărilor în funcție de corectitudine
            int p = 0;

            if (radioButton1.Checked == true)
            {
                p++;
                pictureBox4.Image      = imageList1.Images[0];
                radioButton1.ForeColor = System.Drawing.Color.Black;
            }
            else if (radioButton2.Checked == true || radioButton3.Checked == true)
            {
                pictureBox4.Image = imageList1.Images[1];
            }


            if (radioButton6.Checked == true)
            {
                p++;
                pictureBox6.Image      = imageList1.Images[0];
                radioButton6.ForeColor = System.Drawing.Color.Black;
            }
            else if (radioButton4.Checked == true || radioButton5.Checked == true)
            {
                pictureBox6.Image = imageList1.Images[1];
            }


            if (radioButton7.Checked == true)
            {
                p++;
                pictureBox5.Image      = imageList1.Images[0];
                radioButton7.ForeColor = System.Drawing.Color.Black;
            }
            else if (radioButton8.Checked == true || radioButton9.Checked == true)
            {
                pictureBox5.Image = imageList1.Images[1];
            }


            if (radioButton11.Checked == true)
            {
                p++;
                pictureBox3.Image       = imageList1.Images[0];
                radioButton11.ForeColor = System.Drawing.Color.Black;
            }
            else if (radioButton10.Checked == true || radioButton12.Checked == true)
            {
                pictureBox3.Image = imageList1.Images[1];
            }


            if (radioButton24.Checked == true)
            {
                p++;
                pictureBox2.Image       = imageList1.Images[0];
                radioButton24.ForeColor = System.Drawing.Color.Black;
            }
            else if (radioButton22.Checked == true || radioButton23.Checked == true)
            {
                pictureBox2.Image = imageList1.Images[1];
            }


            if (radioButton21.Checked == true)
            {
                p++;
                pictureBox1.Image       = imageList1.Images[0];
                radioButton21.ForeColor = System.Drawing.Color.Black;
            }
            else if (radioButton20.Checked == true || radioButton19.Checked == true)
            {
                pictureBox1.Image = imageList1.Images[1];
            }


            if (radioButton17.Checked == true)
            {
                p++;
                pictureBox8.Image       = imageList1.Images[0];
                radioButton17.ForeColor = System.Drawing.Color.Black;
            }
            else if (radioButton16.Checked == true || radioButton18.Checked == true)
            {
                pictureBox8.Image = imageList1.Images[1];
            }


            if (radioButton13.Checked == true)
            {
                p++;
                pictureBox7.Image       = imageList1.Images[0];
                radioButton13.ForeColor = System.Drawing.Color.Black;
            }
            else if (radioButton14.Checked == true || radioButton15.Checked == true)
            {
                pictureBox7.Image = imageList1.Images[1];
            }
            //

            //afișarea punctajului obținut
            if (Class1.Limba == 0)
            {
                MessageBox.Show("Punctaj: " + p + "/8", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Score: " + p + "/8", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            if (p == 8)
            {
                this.Hide();
                Form33 f33 = new Form33();
                f33.Show();
            }
            //
        }