示例#1
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            FrmStart objFrmStart = new FrmStart();

            this.Hide();
            objFrmStart.Show();
        }
示例#2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string  username = txtUsername.Text;
            string  password = txtPassword.Text;
            Boolean answer   = db.validateUser(username, password);

            try
            {
                if (answer == true)
                {
                    FrmStart objFrmStart = new FrmStart();
                    this.Hide();
                    objFrmStart.Show();
                }
                else
                {
                    MessageBox.Show("Invalid login.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }