Esempio n. 1
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            if (txtPlayer.Text.Length == 0)
            {
                using (FormChangeName changeName = new FormChangeName())
                {
                    if (changeName.ShowDialog() == DialogResult.OK)
                    {
                        txtPlayer.Text = changeName.getInputName();
                    }
                }
            }
            else
            {
                if (isStarted == false)
                {
                    currentRound = 1;

                    // khơi tạo câu hỏi ban đầu
                    RoundPlaying();
                    timeLeft.assign(totalTime);
                    lbMinutes.Text = timeLeft.getStringMinute();
                    lbSeconds.Text = timeLeft.getStringSecond();
                    Clock.Start();

                    isStarted          = true;
                    btnChoose1.Enabled = true;
                    btnChoose2.Enabled = true;
                    btnRestart.Enabled = true;
                    btnStart.Enabled   = false;
                }
            }
        }
Esempio n. 2
0
        private void changeUsernameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //txtPlayer.Text = "Hiếu";
            //MessageBox.Show("aaaa");

            using (FormChangeName changeName = new FormChangeName())
            {
                if (changeName.ShowDialog() == DialogResult.OK)
                {
                    txtPlayer.Text = changeName.getInputName();
                }
            }
        }