Re: Show/Hide Forms



"Charcoal" <Charcoal@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BC140E5E-4216-4F4F-A6B3-55E1DF643EA6@xxxxxxxxxxxxxxxx
> Not sure that would help. Maybe I don't understand...but,
> Application.Run(new frmLogin());
> would never run after
> Application.Run(new frmSplash());
> the way you suggest...I could be wrong...

Why wouldn't it run? When frmSplash is closed, where do you think execution
goes from there? Application.Run simply sets up a message pump on the Form
passed in. When the form is destroyed, the pump exits, which puts execution
back into Main.

> Also, the splash page is used to setup/validate a data file, init the
> login
> form, and a few other things. I provide the user with information as the
> application loads by refreshing a label after each process. With your
> suggestion the frmLogin object is not even created yet, both forms would
> get
> created before I can even provide the user with update messages...

Then you need an instance of it available to the splash form. Something
like this maybe?

static class Program
{
internal static frmLogin m_frmLogin = new frmLogin();

[MTAThread]
static void Main()
{
Application.Run(new frmSplash());
Application.Run(m_frmLogin);
}

}
}

Or this:

static class Program
{
[MTAThread]
static void Main()
{
frmLogin login = new frmLogin();
Application.Run(new frmSplash(login));
Application.Run(login);
}

}
}

>
> If anybody has a sample of code that will solve this riddle I would add
> you
> to my Christmas list...but you have to hurry cause Christmas is just
> around
> the corner :-)
>
> Again, the old way (windows CE) was to:
>
> Application.Run(new frmSplash());
>
> ...and in the frmSplash_Load event I could do everything...ie
>
> frmSplash.update();
> frmSplash.Show();
> frmLogin Login = new Login();
> Login.Show();
> frmSplash.Hide();
>
> ...it worked great!! What the heck has changed in Mobile 5.0?? Or maybe
> all
> the years of crack smokin is taking it's toll on me....

And I maintain this is a kludge.

-Chris


.