I have already checked some answers that have been made about closing a form after logging in and so on. I tested the many methods in my function, but I did not succeed.
Soon my problem is not a login but a progressbar screen.
I'm doing the following: I have a form that displays a "loading" (progressBar) screen that after loading the entire bar, it should close that form and call a second form containing data.
The problem is that, I can not close the loading form (it is the program's initialization form). If you know any method ...
//primeiro form
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
if (progressBar1.Value < 100)
{
progressBar1.Value = progressBar1.Value +2;
}
else if (progressBar1.Value == 100)
{
timer1.Enabled = false;
Form2 f2 = new Form2();
f2.Show(); // aqui chamo o segundo form
//this.Close() // tentei essa função para fechar o Form1, mas sem sucesso também
}
}