Re: Show/Hide Forms
- From: "Chris Tacke, eMVP" <ctacke@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 15 Dec 2005 14:41:43 -0500
"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
.
- Follow-Ups:
- Re: Show/Hide Forms
- From: Charcoal
- Re: Show/Hide Forms
- From: Charcoal
- Re: Show/Hide Forms
- References:
- Show/Hide Forms
- From: Charcoal
- RE: Show/Hide Forms
- From: Charcoal
- Re: Show/Hide Forms
- From: Chris Tacke, eMVP
- Re: Show/Hide Forms
- From: Charcoal
- Show/Hide Forms
- Prev by Date: Re: PIM Addin Menus
- Next by Date: Developing - a basic question
- Previous by thread: Re: Show/Hide Forms
- Next by thread: Re: Show/Hide Forms
- Index(es):