Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executable VFP Window Size

Status
Not open for further replies.

FoxNovice

Programmer
Apr 10, 2008
25
0
0
US
I have a Foxpro program that opens up a simple interface in a small window. When I make it an executable, the small interface window opens just fine, but in a much larger Microsoft Visual Foxpro window. Is there a way I can programmatically make the Microsoft Visual Foxpro window open in a smaller size when the executable is run? It would just look nicer.

Is this a setting or parameter somewhere when I compile the .prg?

Thanks!

John
 
You can try setting the window state in the startup program.

Example:
_SCREEN.windowstate = 1

You might have to play with it and try all 3 options (1, 2, 3)


Setting Description

0 Normal
1 Minimized (minimized to an icon). If the main Visual FoxPro window is minimized when you exit Visual FoxPro, the main Visual FoxPro window will not display before exiting.

If your application displays a dialog before exiting, be sure to set _SCREEN.WindowState to 0 before displaying the dialog.

2 Maximized (enlarged to fill the screen)


Jim Osieczonek
Delta Business Group, LLC
 
My bad - maybe I didn't explain properly. But thanks for the quick feedback anyway.

I have a Foxpro program that basically opens a small window. I compile that program into an .exe file.

I close VFP completely.

Then I run the .exe from Start, Run, etc. A large window opens, taking up about 75% of my screen. That window has a blue bar running along the top with the words "Microsoft Visual FoxPro". Within this window my program's much, much smaller window opens up.

I would like to decrease the initial size of that large "Microsoft Visual FoxPro" window without have to manually re-size the windows each time I run the .exe.

Hope this helps!

John

 
We hear you.

What you descibe is called the VFP Screen and can be accessed as _SCREEN.

The proposed solution to hide this window and make your small window a top level form is much better then to resize the screen so your form has the _SCREEN size. You'd still have the screen and a doulbe border.

What you want to do is a simple single form application and here's a FAQ on how to do so: faq184-6512

BYe, Olaf.
 
John,

There are two options.

First, in the Init of the form, put the following code:

Code:
WITH _Screen
  .Height = 400
  .Width = 600
ENDWITH

That will resize the outer window (the one with the blue bar) to 400 x 600 pixels. Obviously, you can put whatever figures you like here. But don't make it smaller than your form, otherwise the form will be clipped.

But I wonder if this is what you really want. If the outer window is not relevant to your application (in other words, if you only have the one form, and no other user interface such as menus or toolbars), it would be better to make the outer window invisible. So, put this into the Init of the form:

Code:
This.ShowWindow = 2
_Screen.Visible = .F.

And in the Destroy of the form:

Code:
_Screen.Visible = .T.

That way, the user will only see your form, and nothing else.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 

Hi John,
If you are using a "config.fpw", it should contain a line with :

screen = off

make sure this file is included in your project. In other words, go tot he 'Other' tap on your project window. Under 'Text Files' the "config.fpw" should be present. If not "add" it to the project.

Set the property "ShowWindow" = 2 - As Top Level Form

compile and test

reg
ron O.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top