示例#1
0
        /// <summary>
        /// Transition to a following word.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button28Click(object sender, EventArgs e)
        {
            g.WinCounter++;
            button28.Visible = false;
            g.Filling_conclusion();
            g.WrongLettersCounter = 0;
            Game.CorrectLettersCounter = 0;
            int count = 0;
            label15.Text = "";
            // We specify how many letters in a following word.
            foreach (char el in g.conclusion)
                {
                this.Controls["label" + (count + 1).ToString()].Text = g.conclusion[count].ToString();
                count++;
                }

            for (int i = g.conclusion.Length + 1; i < 11; i++)
                {
                this.Controls["label" + i.ToString()].Text = " ";
                }

            //We return a picture in initial position.
            pictureBox1.Image=null;
            ButtonColor();
            // If all words have been guessed that we remove the form for a victory.
            if (g.WinCounter == 5)
                {
                Form8 f8 = new Form8();
                f8.Opacity = 0;
                f8.Show();
                for (int i = 0; i <= 100; i++)
                    {
                    f8.Opacity = i / 100.0;
                    System.Threading.Thread.Sleep(1);//чем меньше число, тем быстрее появится
                    }
                this.Close();
                g.WinCounter = 0;
                g.WrongLettersCounter = 0;
                Game.RightWordsCounter = 0;
                }
        }
示例#2
0
        /// <summary>
        /// Transition to a following word.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button28Click(object sender, EventArgs e)
            {
            g.WinCounter++;
            Game.RightWordsCounter = g.WinCounter;
            button28.Visible = false;
            g.Filling_conclusion();
            g.WrongLettersCounter = 0;
            Game.CorrectLettersCounter = 0;
            int count = 0;

            // We specify how many letters in a following word.
            foreach (char el in g.conclusion)
                {
                this.Controls["label" + (count + 1).ToString()].Text = g.conclusion[count].ToString();
                count++;
                }

            for (int i = g.conclusion.Length + 1; i < 11; i++)
                {
                this.Controls["label" + i.ToString()].Text = " ";
                }

            //We return a picture in initial position.
            pictureBox1.Image = Image.FromFile(@"Resources\0.jpg");
            ButtonColor();
            //// If all words have been guessed that we remove the form for a victory.
            if (g.WinCounter == 5)
                {
                Form8 f8 = new Form8();
                this.Hide();
                f8.Show();
                g.WinCounter = 0;
                g.WrongLettersCounter = 0;
                Game.RightWordsCounter = 0;
                }
            }