weabow 6 Posted August 4, 2022 Hi there, Closing myapp, I save in the ini the current screen with : Screen.DisplayFromForm(self).Index (self is mainform). It runs fine. I'd like on boot to display the app on the same screen, using my Screen.DisplayFromForm(self).Index saved. I can't see anywhere how to do that. An idea ? Share this post Link to post
Uwe Raabe 2058 Posted August 4, 2022 You cannot directly set a specific display. Instead you position the form so that it is shown on the desired display. Share this post Link to post
weabow 6 Posted August 4, 2022 Thanks. I tried to set Self.Left := -10000; but the form stays on the main screen. Share this post Link to post
Uwe Raabe 2058 Posted August 4, 2022 It works as expected when I place the following code in FormCreate: var displayIndex := Screen.DisplayCount - 1; var display := Screen.Displays[displayIndex]; SetBoundsF(display.Workarea.Left, display.Workarea.Top, Width, Height); 1 Share this post Link to post
mvanrijnen 123 Posted August 5, 2022 Best to remember position instead of displaynumber (and windowmode (maximized or not)). You also want to check if the position you set your form on still is visible, user could have disconnect a display for instance., so you can make sure your app is visible on startup. Share this post Link to post
weabow 6 Posted August 5, 2022 Sure. After several checks, it works fine. Thanks Share this post Link to post