Hi,
I have 2 forms. Form1 (with code below) and Splash (just default form for test).
My problem is that after application run the Splash doesn't hide. Main form is loaded but Splash is still not closed.
The Form1 code:
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Microsoft.VisualBasic.ApplicationServices;
namespace WindowsFormsApplication2
{
class Program : WindowsFormsApplicationBase
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new Form1());
// Show Form in Single-instance mode
var prg = new Program();
prg.EnableVisualStyles = true;
prg.IsSingleInstance = true;
prg.MinimumSplashScreenDisplayTime = 1000;
prg.SplashScreen = new Splash();
prg.MainForm = new Form1();
prg.Run(args);
}
}
}
You must add reference to Microsoft.VisualBasic to work of this.
Splash form code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Splash : Form
{
public Splash()
{
InitializeComponent();
}
}
}
Thank you in advance for your help.