Main Window Default Size/Location

I would like to know what determines where the compiled EXE application window opens and what size it is.

I would like to have the window:

- remember if it was maximized or
- remember last size and position

Right now it is always starting in the top/left corner and I'm not sure what I did to get it that way.

Thanks


Answer this question

Main Window Default Size/Location

  • Webdroid

    You can change the main form to AUTOCENTER = .T. if you want it to always be centered. Is that what you mean or am I oversimplifying this



  • c0d3-m0nk3y

    >You can change the main form to AUTOCENTER = .T. if you want it to always be centered.  Is that what you mean or am I oversimplifying this

    With an SDI form this works very well.


  • Marian Andrei

    I would like to have the window:

    - remember if it was maximized or
    - remember last size and position

    You will have to write some code to remember the settings of _Screen when your application shuts down (perhaps in an ini file or in a dbf).

    Then, in your main startup program, you read the saved settings and restore them.



  • hsaelens

    I'm not sure whether we are talking about the same thing. I am talking about the overall FoxPro window which some people may have turned off. Not talking about the forms.

    Anyway, I found the solution

    Put SCREEN=OFF in the CONFIG.FPW file

    In the startup code of the project reposition and size the window or use autocenter. Then do a _SCREEN.Visible = .T.

    Looks very professional.

    Thanks folks...

  • rgkimball

    You mean _screen.autocenter = .T.

    I'm already doing that in my startup code except I am using _screen.height, width, left and top to manually position it back to where it was when the application last exited.

    - user starts app for the 1st time
    - application window appears at upper left of desktop
    - user manually positions window in the center and resizes
    - user exits application
    - cleanup code auto saves window size and position

    - user re-starts application
    - application window appears at upper left of desktop
    - application window moves and resizes to last auto saved position

    My only complaint is that it is not a very professional looking startup. The window appears and then jumps to the correct location. If I used AUTOCENTER it would do the same thing.

    Do your FoxPro Application.exe windows always open at the upper left

  • EricA_MSFT

    My foxpro exe files always open full screen. I have the icon set to run that way.

    I have a different type of customer, when they use my software they are not on networks, and any other software running is not used at the same time. Everything they need to win a Drag Race is in my program.

    Why do you need the window to remember where it was

    Don Higgins

    www.crewchiefpro.com



  • mikn

    If you must do the procedure to move the window then set lockscreen to .t. then move the form, then set lockscreen to .f.

    It will move without the customer seeing anything.

    Don



  • GaryCanada

    Thanks, I did that and it works.

    Without that code it starts up in the upper left and always the same size. Is there any way to adjust those defaults

  • Main Window Default Size/Location