I wanna show my WinApp in Center Screen, so I set StartPosition
property to CenterScreen
but the window doesn't show in center of screen.
What's wrong with it ? Am I missing something?
P.S:
I show the window from a main window and with a button.
Edit:
The code that I'm using to show the window.
Form_CO form_CO = new Form_CO();
void button_CO_Click(object sender, EventArgs e)
{
try
{
//StaticVariables.Form_CO_IsShown is to prevent opening the same multiple windows
if (!StaticVariables.Form_CO_IsShown)
{
form_CO = new Form_CO();
form_CO.Show();
StaticVariables.Form_CO_IsShown = true;
}
else
{
form_CO.WindowState = FormWindowState.Normal;
form_CO.Activate();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}