I have a Windows Forms Application with a splash screen. When I run the application the splash screen shows up fine, disappears and the main form for the application is loaded.
However, when I load the main form it appears beneath the Windows Explorer directory which contains the application. Here is a segment of code that runs the splash screen and then the main form.
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
Thread t = new Thread(new ThreadStart(SplashStart));
t.Start();
Thread.Sleep(1500);
InitializeComponent();
t.Abort();
}
public void SplashStart()
{
Application.Run(new SplashScreen());
}
}
}
How can I get Form1
to show above all other windows?
Form1.Activate();
This should make it the focus and bring to front.
MSDN link: system windows forms form activate
Use form.BringToFront()
to put the form in front of everything else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With