示例#1
0
        private void button3_Click(object sender, EventArgs e)
        {
            Scadere scadere = new Scadere();

            this.Hide();
            scadere.Closed += (s, args) => this.Close();
            scadere.Show();
        }
示例#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 terminat exercitiile cu scaderi!");
                Meniu meniu = new Meniu();
                this.Hide();
                meniu.Closed += (s, args) => this.Close();
                meniu.Show();
            }
            else if (puncte < 0)
            {
                MessageBox.Show("MAI CITESTE TEORIA!");
                Scadere scadere = new Scadere();
                this.Hide();
                scadere.Closed += (s, args) => this.Close();
                scadere.Show();
            }
        }