I have a winform application with 2 forms, I am calling one form MainForm
from PasswordForm
.
First I set the constructor
private MainForm mainForm = new MainForm();
Then I show the form
mainForm.Show();
However, there is about a 2 second delay in loading the form, because of a number of SQL queries that run on the form load event.
Is there any way I can call an event after the mainForm is shown? (specifically I want to fade out the PasswordForm, which I currently use this
FadeOut(this, 100);
I've tried calling from the MainForm_Shown
event but haven't found a way of referring to the PasswordForm
form?
private void MainForm_Shown(object sender, EventArgs e)
{
// THIS WILL FADE OUT THE 'MAINFORM' BUT I WANT TO FADE OUT THE 'PASSWORDFORM'
FadeOut(this, 100);
}
EDIT Both forms are using the same namespace.