private void button1_KeyPress(object sender, KeyPressEventArgs e)
        {
            this.Close();
            notepad1 obj = new notepad1();

            obj.Show();
        }
Example #2
0
        private void label2_Click(object sender, EventArgs e)
        {
            this.Close();
            notepad1 obj = new notepad1();

            obj.Show();
        }
 private void button1_Click(object sender, EventArgs e)
 {
     if ((usernametextBox.Text == "hassan") && (passwordtextBox.Text == "hassan"))
     {
         this.Close();
         notepad1 obj = new notepad1();
         obj.Show();
     }
     else
     {
         MessageBox.Show("Please Enter Correct Username and Password", "Error !", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }