2
Answers

multiple forms

Monosky babuye

Monosky babuye

13y
2.6k
1
Hi guys, i had a question. i already had a c# form  but now i wanted to created a log on form to verify a user before he can access the second form.  i  placed the code below but still the intial form comes up first.
    
      if ((this.textBoxUsername.Text == "Admin") && (this.textBoxPassword.Text == "mbuyu"))
            {
                Form1 sortform = new Form1();
                sortform.Show();
                this.Hide();
            }
            else
                MessageBox.Show("You are not authorised to access this page", "Info");


        }
How do i make the new form come before the initial form.
Thanks in advance!
Answers (2)