Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 25th, 2012  |  syntax: None  |  size: 0.60 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How do I build a splash screen into a Windows Forms application without setting timers etc?
  2. using Microsoft.VisualBasic.ApplicationServices;
  3.  
  4. public class Startup : WindowsFormsApplicationBase
  5. {
  6.     protected override void OnCreateSplashScreen()
  7.     {
  8.         SplashScreen = new SplashForm();
  9.     }
  10.  
  11.     protected override void OnCreateMainForm()
  12.     {
  13.         MainForm = new MyMainForm();
  14.     }
  15. }
  16.  
  17. static class Program
  18. {
  19.     static void Main(string[] args)
  20.     {
  21.         Application.EnableVisualStyles();
  22.         Application.SetCompatibleTextRenderingDefault(false);
  23.         new Startup().Run(args);
  24.     }
  25. }