Positioning with SetBounds not working on Windows lazarus / 31-LCL ---------------------------------------------------------------------- edvard · 2015-03-25 06:34 I have a problem with positioning a form on creation in Windows7.  In the 'OnCreate' form event, I have the form centered like so: Code: [Select]SetBounds((Screen.Width div 2)-(MainForm.Width div 2), (Screen.Height div 2)-   (MainForm.Width div 2), Width, Height); I do this instead of 'poScreenCenter' because the window is hidden and un-hidden in the course of use, and every time it is un-hidden, the window opens in the center.  Users want the window to open at the last position they left it, and only 'poDefault' or 'poDefaultPosOnly' does that.  This works perfectly in Linux, but not in Windows XP or 7 (haven't tested Windows .  Instead of centering, the window goes to the upper- left corner of the primary monitor (I have 'dmPrimary' set as DefaultMonitor as well).  Setting 'MainForm.Left' and 'MainForm.Top' has the same result. What could be causing this?  Is there another way? EDIT: I think I fixed it by setting the Form Position to 'poDesigned' in the Object Inspector.  The OnCreate 'SetBounds' command now centers the window at startup, and when un-hiding, it appears where you left it last.  Still posting in case others have the same issue.