QUOTE(virusinfektion @ 3 Oct, 2008 - 05:56 PM)

Thanks for the reply, but now im getting this error and cannont seem to fix it. Any tips or hints?
QUOTE
Error 1 The type or namespace name 'Form2' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Paul\AppData\Local\Temporary Projects\myapp\Form1.cs 28 21 myapp
the "Form2" in JacobJordan's code is a generic name given to a newly added form if you don't give it a meaningful name. if you named your second form something else, then you will put the name of YOUR second form in the place of "Form2" in the code example.
for example, if you named your second form "frmMainAfterLogin", then your code would look like this...
CODE
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == ("admin")) // username
{
if (textBox2.Text == ("admin")) // password
{
frmMainAfterLogin f2 = new frmMainAfterLogin();
f2.Show();
}
}
}