How to add splash screen in c #?

VB.NET has the ability to add a pop-up screen when you click "Add new window", but when I do this using C #, I can not find anything.

So

How to add splash screen in c #?

+5
source share
4 answers

Here is a good example. If you are using windows forms.

+6
source

(now I'm on my Mac to dig a little)

You need to open your project settings.

Project → Settings

On the first tab, select the "Startup Object" drop-down menu. The default is Form1.cs. You should be able to change this in the splash screen.

+3
source

Visual Studio 2010 . , "" "SplashScreen".

!

Setting a splash screen

+3

Add a link to Microsoft.VisualBasic. Then write the following code in Program.cs

static class Program
{
   static void Main(string[] args) 
   {
      Application.EnableVisualStyles();
      Application.SetCompatibleTextRenderingDefault(false);
      new MyApp().Run(args);
   }

   public class MyApp : WindowsFormsApplicationBase
   {
      protected override void OnCreateSplashScreen()
      {
         this.SplashScreen = new MySplashScreen();
      }

      protected override void OnCreateMainForm() 
      {
         // Do stuff that requires time
         System.Threading.Thread.Sleep(5000);

         // Create the main form and the splash screen
         // will automatically close at the end of the method
         this.MainForm = new MyMainForm();
      }
   }  
} 
+2
source

All Articles