Show a splash screen at once

后端 未结 4 1334
说谎
说谎 2021-01-05 22:16

We are dealing with slow start for WinForm applications (it is a large application and has many control assemblies). Control assemblies are DevComponents. Ngen was applied t

4条回答
  •  猫巷女王i
    2021-01-05 22:45

    The quick and dirty way that I have done in the past is to have two applications, your main application and your splashscreen application. The main application is normal with all of its heavyweight DLLs, controls, etc. The splashscreen application is simply an application and one Windows form, with all of the unneccesary reference DLLs stripped from the project - in fact you can take this one step further and make use a lighter weight .NET framework like the compact .NET framework or an earlier version of the .NET framework like 1.X or 2.0.

    What you would do is have the splashscreen application startup and immediately show the single splashscreen. Have a Windows form timer (set for say 100 ms) and enable the timer as the last line of the form's Load event. When the timer fires, disable the timer and then launch your real application. See this discussion for how to do that. Now the main application will begin to fire up. Once the application is done with its initialization and perhaps loading the first form, then have the main application kill the splash screen application. More info on killing an application here.

提交回复
热议问题