Exemple #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            Adunare adunare = new Adunare();

            this.Hide();
            adunare.Closed += (s, args) => this.Close();
            adunare.Show();
        }
Exemple #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            numitor1   = Convert.ToInt32(textBox2.Text);
            numitor2   = Convert.ToInt32(textBox4.Text);
            numitor3   = Convert.ToInt32(textBox6.Text);
            numarator1 = Convert.ToInt32(textBox1.Text);
            numarator2 = Convert.ToInt32(textBox3.Text);
            numarator3 = Convert.ToInt32(textBox5.Text);

            if (numitor1 != numitor2)
            {
                if (numitor3 == numitor1 * numitor2 && numarator3 == numarator1 * numitor2 + numarator2 * numitor1)
                {
                    MessageBox.Show("Corect!");
                    puncte       += 2;
                    textBox7.Text = puncte.ToString();
                    numereRandom();
                    textBox5.Clear();
                    textBox6.Clear();
                }
                else
                {
                    MessageBox.Show("Incorect");
                    puncte--;
                    textBox7.Text = puncte.ToString();
                }
            }
            else
            {
                if (numitor3 == numitor2 && numarator3 == numarator1 + numarator2)
                {
                    MessageBox.Show("Corect!");
                    puncte       += 2;
                    textBox7.Text = puncte.ToString();
                    numereRandom();
                    textBox5.Clear();
                    textBox6.Clear();
                }
                else
                {
                    MessageBox.Show("Incorect");
                    puncte--;
                    textBox7.Text = puncte.ToString();
                }
            }

            if (puncte >= 5)
            {
                MessageBox.Show("Felicitari! Ai finalizat exercitiile cu adunari!");
                Meniu meniu = new Meniu();
                this.Hide();
                meniu.Closed += (s, args) => this.Close();
                meniu.Show();
            }
            else if (puncte < 0)
            {
                MessageBox.Show("MAI CITESTE TEORIA!");
                Adunare adunare = new Adunare();
                this.Hide();
                adunare.Closed += (s, args) => this.Close();
                adunare.Show();
            }
        }