3
I have already checked some answers that have been made about closing a form after logging in and so on. I have tested the too many methods in my role, but I was unsuccessful.
So my problem does not consist of a login but a screen with a progression.
I am doing the following: I have a form that presents a screen "loading" (progressiBar) that after having loaded the entire bar, it should close this form and call a second form containing data.
The problem is, I can’t close the loading form (it is the program startup 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
}
}
Consider your main form the form that will be open in the application, and not the form loading, before you open the main form, you display and close the loading
– Rovann Linhalis