Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace YourForm1name
- {
- public partial class Form1 : Form
- {
- string username = "Admin";
- string password = "Admin";
- public Form1()
- {
- InitializeComponent();
- }
- private void label1_Click(object sender, EventArgs e)
- {
- Close();
- }
- private void pictureBox1_Click(object sender, EventArgs e)
- {
- if (textBox1.Text == username)
- {
- if (textBox2.Text == password)
- {
- MessageBox.Show("Login was Succesful!");
- Form2 openform2 = new Form2();
- this.Hide();
- openform2.ShowDialog();
- }else
- {
- MessageBox.Show("Username or Password is Wrong!");
- }
- }
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void label6_Click(object sender, EventArgs e)
- {
- if (textBox1.Text == username)
- {
- if (textBox2.Text == password)
- {
- MessageBox.Show("Login was Succesful!");
- Form2 openform2 = new Form2();
- this.Hide();
- openform2.ShowDialog();
- }else
- {
- MessageBox.Show("Username or Password is Wrong!");
- }
- }
- }
- private void Form1_FormClosed(object sender, FormClosedEventArgs e)
- {
- Application.Exit();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement