Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Shopping shop = new Shopping();

            this.Hide();
            shop.FormClosed += (s, args) => this.Close();
            shop.Show();
        }
Esempio n. 2
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     if (tbUsername.Text == "" || tbPassword.Text == "")
     {
         MessageBox.Show("You must input full information");
     }
     else
     {
         if (tbUsername.Text != "admin" || tbPassword.Text != "123456")
         {
             MessageBox.Show("You must input correct username and password");
         }
         else
         {
             this.Hide();
             var sp = new Shopping();
             sp.Closed += (s, args) => this.Close();
             sp.Show();
         }
     }
 }