I'm actually working on an app which will have to work on a Windows Tablet. I have a weird issue which is pissing me of. Only one of my forms does'nt want to respect de StartPosition.CenterScreen and start as shown on the image.
I've searched tips and tricks but the fact is that it works on my PC so I don't understand what the problem is.
Here are some things I've found that didn't work :
this.StartPosition = FormStartPosition.Manual;
this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height)/2;
this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width)/2;
Instead of
this.StartPosition = FormStartPosition.CenterScreen;
Then I've tried removing those two elements as I've shown during my searches
this.Text;
this.MaximumSize;
And I've put them on the loading event but it didn't work.
Finally I've tried this code in the calling form :
this.Hide();
FrmMain frm = new FrmMain(User, Centrale, Frequence);
frm.StartPosition = FormStartPosition.CenterScreen;
frm.ShowDialog();
this.Close();
But didn't work either. So I require your help, and I only want the form to be centered no matter the way.
================================= UPDATE ==================================
I've found a way to fix my issue. Indeed, thanks to @HansPassant and @Anil, I've tried to change my screen resolution on my own PC, so I could run it with my debugger. After a few attempts, I've changed the AutoScale property even if there was the following message : Obsolete : "This property has been deprecated. Use the AutoScaleMode property instead. http://go.microsoft.com/fwlink/?linkid=14202".
Well thanks for all