private void button1_Click(object sender, EventArgs e) { try { String u_name = textBox1.Text; Int32 password = Int32.Parse(textBox2.Text); if (u_name == "abc" && password == 123) { // MessageBox.Show("Login Successful!"); main m = new main(); m.Show(); } else { MessageBox.Show("Incorrect username or Password"); } }catch (FormatException ex) { } }
private void button2_Click(object sender, EventArgs e) { main m = new main(); m.Show(); }