How to make a form with startup screen

xiaoxiao2021-03-06  14

Need you to prepare two WinForm's forms, a name: SplashScreen, make it a beautiful form. Then you need a main point called it: Form1, then add the following code in this form.

// (C #)

Protected Override Void OnLoad (System.Eventargs E)

{

// make loading take a long time

Thread.sleep (2000);

Base.onLoad (e);

}

Then add such a code in main:

[Stathread]

Static void main ()

{

SplashScreen Splashform = New Splashscreen ();

Splashform.show ();

Form1 mainform = new form1 ();

Mainform.Load = New EventHandler (splashform.mainscreen_load);

Application.run (mainform);

}

Don't forget to add reference to threading: use system.threading;

转载请注明原文地址:https://www.9cbs.com/read-47338.html

New Post(0)