I'm facing a problem when displaying a splash screen in a system with two monitors. When I start the application in the primary display, and then the mouse pointer is moved to the second monitor before the splash screen is shown, my splash screen "follows" the mouse pointer. That means, the splash screen is shown in the 2nd display and after it finishes its work, dissapears and the application is displayed in the primary monitor. This looks pretty ugly and unprofessional.
I have tried to set the property FormStartPosition.CenterScreen in the form's properties and set it in run time in the constructor of my form but none of this has worked. By the way, I'm using C#.
Any hints to achieve that the splash screen be displayed in the same monitor as my application?
Any help will bee deeply appreciated.
Greetings, Victor
In Main, you need to force the form to start on the primary monitor. Here's how to open a form at (0, 0) on the primary monitor.
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form1 f = new Form1();
f.StartPosition = FormStartPosition.Manual;
f.Location = Screen.PrimaryScreen.Bounds.Location;
Application.Run(f);
}
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