public SplashScreen(MenuScreen mainForm) { this.mainForm = mainForm; InitializeComponent(); LoadTimer = new Timer(); LoadTimer.Interval = (int)TimeSpan.FromSeconds(10).TotalMilliseconds; LoadTimer.Tick += LoadTimer_Tick; LoadTimer.Start(); //load backimage from file string path; if (File.Exists(path = Path.Combine(Application.StartupPath, "Data", "Images", "Splash.bmp"))) { this.BackgroundImage = Bitmap.FromFile(path); this.Width = this.BackgroundImage.Width; this.Height = this.BackgroundImage.Height; } }
public MyContext() { MenuScreen ms = new MenuScreen(); new SplashScreen(ms).Show(); ms.Shown += ms_Shown; }