Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Positioning a New Window

Using start_window is it possible to start a new window and have it appear at a specific location on the screen and be a specific size? My code currently moves the window into position and sets the size through the SIZE property but the user sees the window jump into the correct location on screen instead of appearing at the location specified.

I thought there was a way to create a new invisible window, set the size, location, and then make it visible on screen but I can't find the information. Could you point me in the right direction or was there another way to position a new window without it jumping into the new location?

Comments

  • The standard practice is to have the window be invisible at design time and then when the SIZE property is set this will display the form at the right location without the jump affect.
  • Setting the SIZE property makes the window visible, so that can interfere with your goals sometimes. If you want to keep it invisible while you resize, the easiest way is to use SRP_Show_Window from our free SRP Utilities. It lets you show and size a window at the same time.

    Another more complicated option is to use the SetWindowPos WinAPI method, which allows you to set the window's size and position without showing it.
  • Thank you, setting the window to be invisible at design time by un-checking the 'Visible' window property works well enough. I'll keep SRP_Show_Window in mind for future reference, thanks again!
Sign In or Register to comment.