Capn Jack Capn Jack - 1 year ago 71
C# Question

Opening a form, closing it, then opening it again in the same location

I have a pop up selector for my main form that comes up when I click a button. After I make my selection the box is closed and I continue my work in the main form. However if I go to click that button again, the pop up will appear slightly under where it had opened up previously. Is there a way to fix this so that every time that form is opened it opens in the same spot?

Answer Source

Set StartPosition on the Form to Manual

enter image description here

...then give it a fixed value for Location:

enter image description here

If you need it to be in a fixed location relative to the parent, you'll need to calculate that every time you show it, and set Location accordingly.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download