You should use a main class and call all of your forms from that, so
something like this:
public class clsMain
{
public clsMain()
{
//
// TODO: Add constructor logic here
//
}
[STAThread]
static void Main()
{
frmSplash objfrmSplash = new frmSplash();
objfrmSplash.ShowDialog();
clsGlobal.g_objfrmMDIMain = new frmMDIMain();
Application.Run(clsGlobal.g_objfrmMDIMain);
}
//This is the Single Threaded Apartment Model(out of our scope) of the
application which will run the Main function
//when the application starts
}
on your splash screen form place a timer that closes the form after a
few seconds.
(Note:) dont forget to remove the main class from the form that may
already be your main form.
/// <summary>
/// The main entry point for the application.
/// </summary>
//[STAThread]
//static void Main()
//{
// Application.Run(new Form1());
//}
//because we cannot have two Main function.We are invoking everything
from clsMain
[quoted text, click to view] Angelina wrote:
> But I am using .NET 1.1 :(
>
> "GAZ" <gaz@gaz.com> wrote in message
> news:uvJN%23uJtGHA.5044@TK2MSFTNGP05.phx.gbl...
> > With an addition. There is a My.Application.MinimumSplashScreenDispleyTime
> > property through which you can set up the amount of time the splash screen
> > stays visible.
> >
> > BR,
> >
> > GAZ
> >
> > "GAZ" <gaz@gaz.com> wrote in message
> > news:ujqjykItGHA.3548@TK2MSFTNGP04.phx.gbl...
> >> Unless you have some major and lengthy operations to set up your
> >> application environment the splash screen will close almost immediately.
> >> In any case quite a number of dlls have to be already loaded in order to
> >> show the splash form, hence.....
> >>
> >> In VS2005 (if I remember correctly you use VS2003) there is a
> >> SplashScreen item that you can add to your solution and set your
> >> application to show it when it's starting-up. However, it closes down
> >> almost immediately after you start the application.
> >>
> >> You have to create some form of delay on your splash screen in order to
> >> have it shown for a longer period of time. Try with the timer control and
> >> set the delay for five seconds.
> >>
> >> BR,
> >>
> >> GAZ
> >>
> >> "Angelina" <me.angelina@yahoo.com> wrote in message
> >> news:uV3LcsHtGHA.452@TK2MSFTNGP05.phx.gbl...
> >>> What is the best practice to create a splash screen in .net winforms
> >>> applications so that the splash screen loads immediately after we start
> >>> application and closes when all dlls loading and initializations is
> >>> completed. I don't want any idle situation to be seen by the user.
> >>>
> >>> Currently I have created a form and set it visible at start and close it
> >>> after I call application.run for my main form. The problem is that
> >>> splash screen appears after 2-5 seconds of starting the application and
> >>> close immediately.
> >>>
> >>>
> >>> - Angelina
> >>>
> >>
> >>
> >
> >
Unless you have some major and lengthy operations to set up your application
environment the splash screen will close almost immediately. In any case
quite a number of dlls have to be already loaded in order to show the splash
form, hence.....
In VS2005 (if I remember correctly you use VS2003) there is a SplashScreen
item that you can add to your solution and set your application to show it
when it's starting-up. However, it closes down almost immediately after you
start the application.
You have to create some form of delay on your splash screen in order to have
it shown for a longer period of time. Try with the timer control and set the
delay for five seconds.
BR,
GAZ
[quoted text, click to view] "Angelina" <me.angelina@yahoo.com> wrote in message
news:uV3LcsHtGHA.452@TK2MSFTNGP05.phx.gbl...
> What is the best practice to create a splash screen in .net winforms
> applications so that the splash screen loads immediately after we start
> application and closes when all dlls loading and initializations is
> completed. I don't want any idle situation to be seen by the user.
>
> Currently I have created a form and set it visible at start and close it
> after I call application.run for my main form. The problem is that splash
> screen appears after 2-5 seconds of starting the application and close
> immediately.
>
>
> - Angelina
>