Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/100441

From BetaArchive Wiki
Knowledge Base

PRB: Windows Are in Different Positions When Executable Is Run

Article ID: 100441

Article Last Modified on 11/17/2003


  • Microsoft Visual FoxPro 3.0 Standard Edition
  • Microsoft FoxPro 2.6a Standard Edition
  • Microsoft FoxPro 2.6a Professional Edition for Macintosh

This article was previously published under Q100441


Windows appear in different positions when an executable file is run under the run-time version of FoxPro than when the executable file is run under the development version of FoxPro.


The executable file uses FoxFont for the desktop font if no font is specified. The desktop font affects a window's size and position. In the FoxPro development environment, the executable file and the application use the desktop font that is currently in effect. This font is determined by the font setting in the FOXPRO.INI file; therefore, FoxFont may not be the font in use in the development environment.

To achieve the correct result, the following four conditions must all be true:

  1. You must have determined your window positions in the Screen Layout dialog box in the Screen Builder.
  2. The default font that you have specified in the Screen Layout dialog box must match your current screen font.
  3. The point sizes on both the development machine and the machine running the executable file must be the same.
  4. Both machines must be using the same resolution (for example, 640 x 480 or 1024 x 768).


There are two ways to resolve this problem:

  • Change the desktop font in FoxPro to FoxFont before designing the screen. To do this, either hold down the SHIFT key and choose Font from the Text menu, or issue the following command:

          MODIFY WINDOW SCREEN FONT "Foxfont",9


  • Specify the desktop font that will be used by the executable outside the development environment by entering the following lines in the Setup code for the screen set:

          #SECTION 1            && places code at the beginning of the SPR
          MODIFY WINDOW SCREEN FONT "Arial"  && specifies desktop font

    You can use other fonts besides Arial. If the executable is to be run under Windows 3.0, use a font available to Windows 3.0 and Windows 3.1. To verify that the correct font is being used, add the line:

          WAIT WINDOW WFONT(1)

Additional query words: VFoxWin FoxMac FoxWin 2.50 2.50a 2.50b 2.50c 2.60 arrange exe screen position font

Keywords: KB100441