Salve ragazzi sono nuovo, allora ho un problema io vorrei che quando inserisco dei dati in 2 textbox me li verifichi e se sono giusti mi parta l'avanzamento di una progressbar e poi apra il secondo form al termine dell'avanzamento della progressbar. Pero mi apre la form2 tantissime volte e se non premo stop al debug mi si riempie tutto lo schermo. Ecco il codice

codice:
    private void button1_Click(object sender, EventArgs e)     {       if (textBox1.Text == "Andrea")         if (textBox2.Text == "Pirola")           timer1.Enabled = true;         {         if (textBox1.Text == "Andrea")           if (textBox2.Text != "Pirola")             MessageBox.Show("Password Errata!", "Login");       }       {         if (textBox2.Text == "Pirola")           if (textBox1.Text != "Andrea")             MessageBox.Show("Id errato", "Login");       }       {         if (textBox1.Text == "")           if (textBox2.Text == "")             MessageBox.Show("Inserisci i Dati!");       }       {        }     }      private void timer1_Tick(object sender, EventArgs e)     {       Form3 frm = new Form3();       if (textBox1.Text == "Andrea")         if (textBox2.Text == "Pirola")           progressBar1.PerformStep();       if (progressBar1.Value == progressBar1.Maximum)         frm.Show();             }   } }
Spero di essere stato chiaro
Saluti Andrea
Il codice forse lo leggete male in questa maniera lo metto anche normale

private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "Andrea")
if (textBox2.Text == "Pirola")
timer1.Enabled = true;


{
if (textBox1.Text == "Andrea")
if (textBox2.Text != "Pirola")
MessageBox.Show("Password Errata!", "Login");
}
{
if (textBox2.Text == "Pirola")
if (textBox1.Text != "Andrea")
MessageBox.Show("Id errato", "Login");
}
{
if (textBox1.Text == "")
if (textBox2.Text == "")
MessageBox.Show("Inserisci i Dati!");
}
{

}
}

private void timer1_Tick(object sender, EventArgs e)
{
Form3 frm = new Form3();
if (textBox1.Text == "Andrea")
if (textBox2.Text == "Pirola")
progressBar1.PerformStep();
if (progressBar1.Value == progressBar1.Maximum)
frm.Show();


}
}
}