How can i set the Form to be in the Center of the Screen?
<p>I'm using this code:</p>

<pre><code>private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
    this.Show();
    this.WindowState = FormWindowState.Normal;
    //this.Location = new Point(form1_location_on_x, form1_location_on_y);
    //this.StartPosition = FormStartPosition.CenterScreen;
</code></pre>

<p>Either the line</p>

<pre><code>this.Location = new Point(form1_location_on_x, form1_location_on_y);
</code></pre>

<p>or the line</p>

<pre><code>this.StartPosition = FormStartPosition.CenterScreen;
</code></pre>

<p>are working when I'm on my original screen resolution 1920x1080, but once I'm changing the resolution to 1024x768, the Form is on the right bottom corner not hidden I see it all but it's not in the center.</p>

<p>form1_location_on_x and on_y are:</p>

<pre><code>form1_location_on_x = this.Location.X;
form1_location_on_y = this.Location.Y;
</code></pre>

<p>The question is what should I do to make it work on any other resolution like 1024x768 or any others? I tried many changes but nothing worked so far.</p>
