Login screen using user custom control

Posted by Mocco on Stack Overflow See other posts from Stack Overflow or by Mocco
Published on 2011-03-17T16:04:50Z Indexed on 2011/03/17 16:09 UTC
Read the original article Hit count: 149

Filed under:
|
|
|

Hi, I have followed some advices I got here today and would need a bit more help now:

I have an user control with login logic. In mainForm I am using this:

private void Form1_Load(object sender, EventArgs e)
{
        LoginScreen login = new MainMenu();
                    login.Parent = this;
                    login.Dock = DockStyle.Fill;
                    login.Show();
}

But I guess it is not modal and thus does not stop the original Form application. Sure I would need the main Form to do not continue until the login form is closed (and login sucessfull).

Would using an event correct? Let login object to raise an event that login was successfull and let the MainForm handle it - run the app?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET