private void nepravilno()                                                                                                                       // v primeru da je odgovor napačen sproži funkcijo
        {
            The_end mainform = new The_end();                                                                                                           // definiraj formo the end kot glavno formo

            this.Hide();                                                                                                                                // skrij to formo
            mainform.Show();                                                                                                                            // prikaži glavno formo
        }
        private void wrong_function()         // spremeni formo na endform
        {
            The_end mainform = new The_end(); // definiraj formo the end kot glavno formo

            this.Hide();                      // skrij to formo
            mainform.Show();                  // prikaži novo formo
        }
Esempio n. 3
0
 private void btnback_Click(object sender, EventArgs e)                                  // Back to form that you came from
 {
     if (forma == 3)                                                                     // Return to form _ The_end
     {
         Form1.form = 4;
         The_end mainform = new The_end();
         this.Hide();
         mainform.Show();
     }
     else if (forma == 0)                                                                // return to form  _ Vpis
     {
         Form1.form = 4;
         Form1 mainform = new Form1();
         this.Hide();
         mainform.Show();
     }
 }
        //////////////////////////////////////////////////////////////////

        private void right()                                                                // v primeru da je odgovor pravilen sproži funkcijo
        {
            result++;
            btnansa.Enabled = true;
            btnansb.Enabled = true;
            btnansc.Enabled = true;
            btnansd.Enabled = true;
            switch (result)                                                                                                                           // pobarva gumb z nagrado
            {
            case 0:
                btnreward1.BackColor = Color.YellowGreen; btnreward.Text = "0 $"; points = 0;
                /*btnreward1.BackColor = Color.Black;*/
                btnreward2.BackColor  = Color.Black; btnreward3.BackColor = Color.Black; btnreward4.BackColor = Color.Black; btnreward5.BackColor = Color.Black;
                btnreward6.BackColor  = Color.Black; btnreward7.BackColor = Color.Black; btnreward8.BackColor = Color.Black; btnreward9.BackColor = Color.Black; btnreward10.BackColor = Color.Black;
                btnreward11.BackColor = Color.Black; btnreward12.BackColor = Color.Black; btnreward13.BackColor = Color.Black; btnreward14.BackColor = Color.Black; btnreward15.BackColor = Color.Black;
                break;

            case 1:
                btnreward2.BackColor  = Color.YellowGreen; btnreward.Text = btnreward1.Text; points = 100;
                btnreward1.BackColor  = Color.Black; /*btnreward2.BackColor = Color.Black;*/ btnreward3.BackColor = Color.Black; btnreward4.BackColor = Color.Black; btnreward5.BackColor = Color.Black;
                btnreward6.BackColor  = Color.Black; btnreward7.BackColor = Color.Black; btnreward8.BackColor = Color.Black; btnreward9.BackColor = Color.Black; btnreward10.BackColor = Color.Black;
                btnreward11.BackColor = Color.Black; btnreward12.BackColor = Color.Black; btnreward13.BackColor = Color.Black; btnreward14.BackColor = Color.Black; btnreward15.BackColor = Color.Black;
                break;

            case 2:
                btnreward3.BackColor  = Color.YellowGreen; btnreward.Text = btnreward2.Text; points = 200;
                btnreward1.BackColor  = Color.Black; btnreward2.BackColor = Color.Black; /*btnreward3.BackColor = Color.Black;*/ btnreward4.BackColor = Color.Black; btnreward5.BackColor = Color.Black;
                btnreward6.BackColor  = Color.Black; btnreward7.BackColor = Color.Black; btnreward8.BackColor = Color.Black; btnreward9.BackColor = Color.Black; btnreward10.BackColor = Color.Black;
                btnreward11.BackColor = Color.Black; btnreward12.BackColor = Color.Black; btnreward13.BackColor = Color.Black; btnreward14.BackColor = Color.Black; btnreward15.BackColor = Color.Black;
                break;

            case 3:
                btnreward4.BackColor  = Color.YellowGreen; btnreward.Text = btnreward3.Text; points = 300;
                btnreward1.BackColor  = Color.Black; btnreward2.BackColor = Color.Black; btnreward3.BackColor = Color.Black; /*btnreward4.BackColor = Color.Black;*/ btnreward5.BackColor = Color.Black;
                btnreward6.BackColor  = Color.Black; btnreward7.BackColor = Color.Black; btnreward8.BackColor = Color.Black; btnreward9.BackColor = Color.Black; btnreward10.BackColor = Color.Black;
                btnreward11.BackColor = Color.Black; btnreward12.BackColor = Color.Black; btnreward13.BackColor = Color.Black; btnreward14.BackColor = Color.Black; btnreward15.BackColor = Color.Black;
                break;

            case 4:
                btnreward5.BackColor  = Color.YellowGreen; btnreward.Text = btnreward4.Text; points = 500;
                btnreward1.BackColor  = Color.Black; btnreward2.BackColor = Color.Black; btnreward3.BackColor = Color.Black; btnreward4.BackColor = Color.Black;    /*btnreward5.BackColor = Color.Black;*/
                btnreward6.BackColor  = Color.Black; btnreward7.BackColor = Color.Black; btnreward8.BackColor = Color.Black; btnreward9.BackColor = Color.Black; btnreward10.BackColor = Color.Black;
                btnreward11.BackColor = Color.Black; btnreward12.BackColor = Color.Black; btnreward13.BackColor = Color.Black; btnreward14.BackColor = Color.Black; btnreward15.BackColor = Color.Black;
                break;

            case 5:
                btnreward6.BackColor = Color.YellowGreen; btnreward.Text = btnreward5.Text; points = 1000;
                btnreward1.BackColor = Color.Black; btnreward2.BackColor = Color.Black; btnreward3.BackColor = Color.Black; btnreward4.BackColor = Color.Black; btnreward5.BackColor = Color.Black;
                /*btnreward6.BackColor = Color.Black;*/
                btnreward7.BackColor  = Color.Black; btnreward8.BackColor = Color.Black; btnreward9.BackColor = Color.Black; btnreward10.BackColor = Color.Black;
                btnreward11.BackColor = Color.Black; btnreward12.BackColor = Color.Black; btnreward13.BackColor = Color.Black; btnreward14.BackColor = Color.Black; btnreward15.BackColor = Color.Black;
                break;

            case 6:
                btnreward7.BackColor  = Color.YellowGreen; btnreward.Text = btnreward6.Text; points = 2000;
                btnreward1.BackColor  = Color.Black; btnreward2.BackColor = Color.Black; btnreward3.BackColor = Color.Black; btnreward4.BackColor = Color.Black; btnreward5.BackColor = Color.Black;
                btnreward6.BackColor  = Color.Black; /*btnreward7.BackColor = Color.Black;*/ btnreward8.BackColor = Color.Black; btnreward9.BackColor = Color.Black; btnreward10.BackColor = Color.Black;
                btnreward11.BackColor = Color.Black; btnreward12.BackColor = Color.Black; btnreward13.BackColor = Color.Black; btnreward14.BackColor = Color.Black; btnreward15.BackColor = Color.Black;
                break;

            case 7:
                btnreward8.BackColor  = Color.YellowGreen; btnreward.Text = btnreward7.Text; points = 4000;
                btnreward1.BackColor  = Color.Black; btnreward2.BackColor = Color.Black; btnreward3.BackColor = Color.Black; btnreward4.BackColor = Color.Black; btnreward5.BackColor = Color.Black;
                btnreward6.BackColor  = Color.Black; btnreward7.BackColor = Color.Black; /*btnreward8.BackColor = Color.Black;*/ btnreward9.BackColor = Color.Black; btnreward10.BackColor = Color.Black;
                btnreward11.BackColor = Color.Black; btnreward12.BackColor = Color.Black; btnreward13.BackColor = Color.Black; btnreward14.BackColor = Color.Black; btnreward15.BackColor = Color.Black;
                break;

            case 8:
                btnreward9.BackColor  = Color.YellowGreen; btnreward.Text = btnreward8.Text; points = 8000;
                btnreward1.BackColor  = Color.Black; btnreward2.BackColor = Color.Black; btnreward3.BackColor = Color.Black; btnreward4.BackColor = Color.Black; btnreward5.BackColor = Color.Black;
                btnreward6.BackColor  = Color.Black; btnreward7.BackColor = Color.Black; btnreward8.BackColor = Color.Black; /*btnreward9.BackColor = Color.Black;*/ btnreward10.BackColor = Color.Black;
                btnreward11.BackColor = Color.Black; btnreward12.BackColor = Color.Black; btnreward13.BackColor = Color.Black; btnreward14.BackColor = Color.Black; btnreward15.BackColor = Color.Black;
                break;

            case 9:
                btnreward10.BackColor = Color.YellowGreen; btnreward.Text = btnreward9.Text; points = 16000;
                btnreward1.BackColor  = Color.Black; btnreward2.BackColor = Color.Black; btnreward3.BackColor = Color.Black; btnreward4.BackColor = Color.Black; btnreward5.BackColor = Color.Black;
                btnreward6.BackColor  = Color.Black; btnreward7.BackColor = Color.Black; btnreward8.BackColor = Color.Black; btnreward9.BackColor = Color.Black;    /*btnreward10.BackColor = Color.Black;*/
                btnreward11.BackColor = Color.Black; btnreward12.BackColor = Color.Black; btnreward13.BackColor = Color.Black; btnreward14.BackColor = Color.Black; btnreward15.BackColor = Color.Black;
                break;

            case 10:
                btnreward11.BackColor = Color.YellowGreen; btnreward.Text = btnreward10.Text; points = 32000;
                btnreward1.BackColor  = Color.Black; btnreward2.BackColor = Color.Black; btnreward3.BackColor = Color.Black; btnreward4.BackColor = Color.Black; btnreward5.BackColor = Color.Black;
                btnreward6.BackColor  = Color.Black; btnreward7.BackColor = Color.Black; btnreward8.BackColor = Color.Black; btnreward9.BackColor = Color.Black; btnreward10.BackColor = Color.Black;
                /*btnreward11.BackColor = Color.Black;*/
                btnreward12.BackColor = Color.Black; btnreward13.BackColor = Color.Black; btnreward14.BackColor = Color.Black; btnreward15.BackColor = Color.Black;
                break;

            case 11:
                btnreward12.BackColor = Color.YellowGreen; btnreward.Text = btnreward11.Text; points = 64000;
                btnreward1.BackColor  = Color.Black; btnreward2.BackColor = Color.Black; btnreward3.BackColor = Color.Black; btnreward4.BackColor = Color.Black; btnreward5.BackColor = Color.Black;
                btnreward6.BackColor  = Color.Black; btnreward7.BackColor = Color.Black; btnreward8.BackColor = Color.Black; btnreward9.BackColor = Color.Black; btnreward10.BackColor = Color.Black;
                btnreward11.BackColor = Color.Black; /*btnreward12.BackColor = Color.Black;*/ btnreward13.BackColor = Color.Black; btnreward14.BackColor = Color.Black; btnreward15.BackColor = Color.Black;
                break;

            case 12:
                btnreward13.BackColor = Color.YellowGreen; btnreward.Text = btnreward12.Text; points = 125000;
                btnreward1.BackColor  = Color.Black; btnreward2.BackColor = Color.Black; btnreward3.BackColor = Color.Black; btnreward4.BackColor = Color.Black; btnreward5.BackColor = Color.Black;
                btnreward6.BackColor  = Color.Black; btnreward7.BackColor = Color.Black; btnreward8.BackColor = Color.Black; btnreward9.BackColor = Color.Black; btnreward10.BackColor = Color.Black;
                btnreward11.BackColor = Color.Black; btnreward12.BackColor = Color.Black; /*btnreward13.BackColor = Color.Black;*/ btnreward14.BackColor = Color.Black; btnreward15.BackColor = Color.Black;
                break;

            case 13:
                btnreward14.BackColor = Color.YellowGreen; btnreward.Text = btnreward13.Text; points = 250000;
                btnreward1.BackColor  = Color.Black; btnreward2.BackColor = Color.Black; btnreward3.BackColor = Color.Black; btnreward4.BackColor = Color.Black; btnreward5.BackColor = Color.Black;
                btnreward6.BackColor  = Color.Black; btnreward7.BackColor = Color.Black; btnreward8.BackColor = Color.Black; btnreward9.BackColor = Color.Black; btnreward10.BackColor = Color.Black;
                btnreward11.BackColor = Color.Black; btnreward12.BackColor = Color.Black; btnreward13.BackColor = Color.Black; /*btnreward14.BackColor = Color.Black;*/ btnreward15.BackColor = Color.Black;
                break;

            case 14:
                btnreward15.BackColor = Color.YellowGreen; btnreward.Text = btnreward14.Text; points = 500000;
                btnreward1.BackColor  = Color.Black; btnreward2.BackColor = Color.Black; btnreward3.BackColor = Color.Black; btnreward4.BackColor = Color.Black; btnreward5.BackColor = Color.Black;
                btnreward6.BackColor  = Color.Black; btnreward7.BackColor = Color.Black; btnreward8.BackColor = Color.Black; btnreward9.BackColor = Color.Black; btnreward10.BackColor = Color.Black;
                btnreward11.BackColor = Color.Black; btnreward12.BackColor = Color.Black; btnreward13.BackColor = Color.Black; btnreward14.BackColor = Color.Black;     /*btnreward15.BackColor = Color.Black;*/
                break;

            case 15:
                points = 1000000;
                form   = 2;
                The_end mainform = new The_end();                                                                                                       // definiraj formo the end kot glavno formo
                this.Hide();                                                                                                                            // skrij to formo
                mainform.Show();                                                                                                                        // prikaži glavno formo
                break;
            }
            randomize_function();
        }