owned form

  • Thread starter Thread starter Hrvoje Voda
  • Start date Start date
H

Hrvoje Voda

I' using this code to call a loginForm(that form is in another classLibrary)

This is a Main Form from witch I'm calling login form:

void Login()

{

LoginForm lf = new LoginForm();

this.AddOwnedForm(lf);

lf.ShowDialog(this);

}

private void MainForm_Load(object sender, EventArgs e)

{

Login();

}

Problem is that I don't see MainForm under the LoginForm.

Why?

Hrcko
 
Load happens just *before* the form is first shown, so at the time when
you create the login form, the main form has not been displayed.

Also - when using ShowDialog(owner), you don't really need the
AddOwnedForm step.

Marc
 
Back
Top