Esempio n. 1
0
 /// <summary>
 /// Button thoát
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btThoat_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Bạn có muốn thoát ?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         Form f = new FrmSavePoint();
         f.Show();
         //Hide();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Button Enter
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btEnter_Click(object sender, EventArgs e)
        {
            string strDapAn = "";

            if (level < 64)
            {
                for (int i = 0; i < arrLabel.Length; i++)
                {
                    if (arrLabel[i].Text != null)
                    {
                        strDapAn += arrLabel[i].Text.Trim();
                    }
                }
                if (arrLabel != null)
                {
                    char[] c = strDapAn.ToCharArray();
                    strDapAn = "";

                    for (int i = 0; i < c.Length; i++)
                    {
                        if (c[i] != ' ')
                        {
                            c[i] = char.ToLower(c[i]);
                        }

                        strDapAn += c[i].ToString();
                    }
                    if ((strDapAn) == getAnswer())
                    {
                        MessageBox.Show("Đúng!!!!!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        level++;
                        Diem        += 5;
                        lbDiem.Text  = Diem.ToString();
                        lbLevel.Text = level.ToString();
                        CauHoi       = RandQuestion();
                        LoadPicture();
                        btGoiY.Enabled = true;
                        Addlabels();
                        AddButtons();
                    }
                    else
                    {
                        if (MessageBox.Show("Sai!!!! \nBạn có muốn chơi lại?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                        {
                            Reset();
                        }
                        else
                        {
                            Form f = new FrmSavePoint();
                            f.Show();
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Bạn phải nhập đáp án.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show("Bạn đã thắng trò chơi!!!!!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }