owned form

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
 
M

Marc Gravell

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top