Exemple #1
0
 private void CreateTimer()
 {
     gbTime.Controls.Clear();
     uc_cdt = new UC_CountDownTimer(0, 5, 0);
     uc_cdt.EnabledChanged += new EventHandler(uc_cdt_EnabledChanged);
     uc_cdt.Location = SubFunction.SetCenterLocation(gbTime.Size, uc_cdt.Size);
     gbTime.Controls.Add(uc_cdt);
 }
Exemple #2
0
        private void InitForm()
        {
            pnSteps.Controls.Clear();
            lbRemain.Text = "Số lần còn lại";

            gbCreate.Enabled = true;
            gbPlay.Enabled = false;

            uc_HuongDan.Visible = true;
            gbThongDiep.Visible = false;

            gbTime.Controls.Clear();
            uc_cdt = new UC_CountDownTimer(0, 5, 0);
            uc_cdt.Location = SubFunction.SetCenterLocation(gbTime.Size, uc_cdt.Size);
            gbTime.Controls.Add(uc_cdt);
            uc_cdt.Enabled = false;

            tbNumber.Text = "";
            tbGuess.Text = "";

            lbError_Create.Text = "";
            lbError_Play.Text = "";

            btPlay.Enabled = true;
        }
Exemple #3
0
        private void btPlay_Click(object sender, EventArgs e)
        {
            newGameToolStripMenuItem_Click(sender, e);
            btAuto_Click(sender, e);

            if (TestSo(tbNumber.Text))
            {
                if (TestSoHopLe(tbNumber.Text))
                {
                    gbCreate.Enabled = false;
                    tbNumber.UseSystemPasswordChar = true;

                    gbTime.Controls.Clear();
                    uc_cdt = new UC_CountDownTimer(0, 5, 0);
                    uc_cdt.EnabledChanged += new EventHandler(uc_cdt_EnabledChanged);
                    uc_cdt.Location = SubFunction.SetCenterLocation(gbTime.Size, uc_cdt.Size);
                    gbTime.Controls.Add(uc_cdt);

                    gbPlay.Enabled = true;
                    tbGuess.Focus();
                }
                else
                {
                    SubFunction.SetError(lbError_Create, lbError_Create.Location.Y, gbCreate.Size, "Các chữ số phải khác nhau!");
                }
            }
            else
            {
                SubFunction.SetError(lbError_Create, lbError_Create.Location.Y, gbCreate.Size, "Tắt bộ gõ dấu tiếng Việt");
            }
        }