private void toolStripButton7_Click(object sender, EventArgs e)
        {
            Form_Main main = new Form_Main();

            this.Hide();
            main.Show();
        }
Esempio n. 2
0
        private void btRegister_Click(object sender, EventArgs e)
        {
            if (CheckNull())
            {
                return;
            }

            if (CheckRegister())
            {
                xuiFlatProgressBar_Login.Visible = true;

                for (int i = 0; i < 100; i++)
                {
                    xuiFlatProgressBar_Login.Value = i;
                    xuiFlatProgressBar_Login.Update();
                    System.Threading.Thread.Sleep(10);
                }

                loginAccount = AccountBUS.Instance.GetAccountByUserName(tbUsername.Text);

                string path = System.IO.Path.GetFullPath(System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), @"..\..\Resources"));
                AccountBUS.Instance.SavePicture(loginAccount.ID, path, "default-user-picture.png");

                fMain = new Form_Main(loginAccount, father);
                fMain.Show();
                this.Hide();
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            BUS_User        us   = new BUS_User();
            List <DangNhap> dn   = us.dangNhap();
            bool            test = false;

            for (int i = 0; i < dn.Count; i++)
            {
                if (dn[i].tendangnhap.ToString() == txtUser.Text.ToString() &&
                    dn[i].matkhau.ToString() == txtPassWords.Text.ToString())
                {
                    test = true;
                }
            }
            if (test)
            {
                MessageBox.Show("Đăng nhập thành công", "Thông báo", MessageBoxButtons.OK);
                this.Hide();
                Form_Main main = new Form_Main();
                main.Show();
            }
            else
            {
                MessageBox.Show("Bạn đã điền sai tên đăng nhập hoặc mật khẩu ! ", "Thông báo", MessageBoxButtons.OK);
                setNull();
            }
        }
        public UserControl_Flashcard(Form_Main formMain)
        {
            InitializeComponent();

            father = formMain;
            this.Focus();
            this.Select();
        }
        public Form_Game_BuildBridge(Form_Main father, int num, int time)
        {
            InitializeComponent();

            pictureBox1.Hide();
            pictureBox2.Hide();
            countDown        = time;
            timeCountDown    = time;
            n                = num;
            numberOfQuestion = num;

            items = DictionaryBUS.Instance.GetFillBlank();

            this.father = father;
            label_numOfQuestion.Text = n.ToString();
            label_Time.Text          = time.ToString();
            label_Time.Show();

            #region Music Init
            musicBackGround = new AxWindowsMediaPlayer();
            musicCorrect    = new AxWindowsMediaPlayer();
            musicWrong      = new AxWindowsMediaPlayer();
            musicvictory    = new AxWindowsMediaPlayer();
            musicLose       = new AxWindowsMediaPlayer();

            musicBackGround.CreateControl();
            musicCorrect.CreateControl();
            musicWrong.CreateControl();
            musicvictory.CreateControl();
            musicLose.CreateControl();

            var currentPath = Directory.GetCurrentDirectory();
            currentPath = Path.GetFullPath(Path.Combine(currentPath, @"..\..\Resources\SoundTrack"));

            musicBackGround.URL = Path.Combine(currentPath, "background.wav");
            musicCorrect.URL    = Path.Combine(currentPath, "knock.wav");
            musicWrong.URL      = Path.Combine(currentPath, "boom.wav");
            musicvictory.URL    = Path.Combine(currentPath, "victory.wav");
            musicLose.URL       = Path.Combine(currentPath, "lose.wav");
            #endregion

            stopAllMusic();

            musicBackGround.Ctlcontrols.play();
            key = items.Rows[rand.Next(0, items.Rows.Count)];
            label_Question.Text = key["Question"].ToString();
            timer_Bridge.Start();
            timer_countDown.Start();
        }
Esempio n. 6
0
        public Form_Game_CarRacing(Form_Main father, int num, int time)
        {
            InitializeComponent();

            pictureBox1.Hide();
            items = DictionaryBUS.Instance.GetQuiz();

            numberOfQuestion = num;//state
            n = num;

            this.time = time;//state
            countDown = time;

            items              = BUS.DictionaryBUS.Instance.GetQuiz();
            this.father        = father;
            label_NumQues.Text = n.ToString();
            label_Time.Text    = time.ToString();


            #region Music Init
            musicBackGround = new AxWindowsMediaPlayer();
            musicCoin       = new AxWindowsMediaPlayer();
            musicBoom       = new AxWindowsMediaPlayer();

            musicBackGround.CreateControl();
            musicCoin.CreateControl();
            musicBoom.CreateControl();

            var currentPath = Directory.GetCurrentDirectory();
            currentPath = Path.GetFullPath(Path.Combine(currentPath, @"..\..\Resources\SoundTrack"));

            musicBackGround.URL = Path.Combine(currentPath, "backgroundCar.wav");
            musicCoin.URL       = Path.Combine(currentPath, "coin.wav");
            musicBoom.URL       = Path.Combine(currentPath, "boom.wav");
            #endregion

            stopAllMusic();

            musicBackGround.Ctlcontrols.play();

            taotrachnghiem();

            timer1.Start();

            timer_carRacing.Start();
        }
Esempio n. 7
0
        private void btLogin_Click(object sender, EventArgs e)
        {
            if (CheckNull())
            {
                return;
            }

            if (CheckLogin())
            {
                xuiFlatProgressBar_Login.Visible = true;

                for (int i = 0; i < 100; i++)
                {
                    xuiFlatProgressBar_Login.Value = i;
                    xuiFlatProgressBar_Login.Update();
                    Thread.Sleep(10);
                }

                loginAccount = AccountBUS.Instance.GetAccountByUserName(tbUsername.Text);
                fMain        = new Form_Main(loginAccount, this);
                fMain.Show();
                this.Hide();
            }
        }
        public UserControl_Grammar(Form_Main father)
        {
            InitializeComponent();

            this.father = father;
        }
 public UserControl_UserDashboard(Form_Main fMain)
 {
     InitializeComponent();
     father = fMain;
 }
 public UserControl_Translate(Form_Main form_Main)
 {
     InitializeComponent();
     father = form_Main;
 }