private void restart_Click(object sender, RoutedEventArgs e)
        {
            Gaseste_regula form = new Gaseste_regula(n, nr, parametru);

            form.Show();
            this.Hide();
        }
示例#2
0
        private void apas_buton(object sender, RoutedEventArgs e)
        {
            Button b = (Button)sender;

            for (int i = 1; i <= 16; i++)
            {
                if (b.Name == "button" + i.ToString())
                {
                    if (n < nr_dificultate)
                    {
                        Gaseste_regula form = new Gaseste_regula(n, Convert.ToInt32(b.Content), parametru);
                        form.Show();
                        this.Hide();
                        break;
                    }
                    else if (n == nr_dificultate)
                    {
                        if (i <= nr_nivel)
                        {
                            Gaseste_regula form = new Gaseste_regula(n, Convert.ToInt32(b.Content), parametru);
                            form.Show();
                            this.Hide();
                            break;
                        }
                    }
                }
            }
        }
        private void buton_nivel_Click(object sender, RoutedEventArgs e)
        {
            Button buton = (Button)sender;
            int    ok    = 1;

            if (buton.Name != "nivel_close")
            {
                for (int i = 1; i <= 4; i++)
                {
                    if (buton.Name == "bonus" + i.ToString())
                    {
                        ok = 0;
                        break;
                    }
                }
                if (ok == 1)
                {
                    for (int i = 1; i <= 16; i++)
                    {
                        if (buton.Name == "button" + i.ToString())
                        {
                            if (m < nr_dificultate)
                            {
                                nr = i;
                                Gaseste_regula form = new Gaseste_regula(m, nr, parametru);
                                form.Show();
                                this.Hide();
                                break;
                            }
                            else if (m == nr_dificultate)
                            {
                                if (i <= nr_nivel)
                                {
                                    nr = i;
                                    Gaseste_regula form = new Gaseste_regula(m, nr, parametru);
                                    form.Show();
                                    this.Hide();
                                    break;
                                }
                            }
                        }
                    }
                }
            }
        }