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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem in Size of windows in Executable program ...

Status
Not open for further replies.

MAliShah

Programmer
Nov 22, 2002
27
Hi all
I need ur help. When I run the exe file, the size of windows which I defined in program is not the same. For this, the message like "position is off the screen" or the location of windows on the screen is different as was in the pogram. Is there any solution in which the display on screen (of varying sizes of monitor) remain the same?
Thanks and regards in advance
 
MAliShah,

Try the following commands:

WITH _Screen
.BorderStyle = 3
.Closable = .T.
.ControlBox = .T.
.Movable = .T.
.MaxButton = .T.
.MinButton = .T.
.WindowState = 2
.ScrollBars = 3
.WindowType = 0
.Height = Sysmetric(2)-50
.MaxWidth = -1
.TitleBar = 1
ENDWITH



Gene
 
how did you "define" your window? visually or by code? maybe you could post your code here so we can understand more on what's causing the problem. [smile]

kilroy [trooper]
philippines

"Illegitimis non carborundum!"
 
Gene, I used ur code but it did not solve the problem
Hi Kilroy,
I used the following code........
defi wind la from 0,3 to 30,110 font 'Book Antiqua' ,12 STYLE 'B' ;
shadow doubl mdi fill file sbp.jpg noclose nofloat colo sche 4
 
The problem with creating windows using the old FP DOS (xBase) code, is that VFP uses the current window's (FORM or _SCREEN) properties to create it. So the 0,3 to 30,110 character positions are calculated using the current font's fontmetric settings - not the font you specify in the DEFINE WINDOW command. If the current font setting was Courier New - 40, that would exceed almost any resolution supported - giving you an error message similar to what you've described.

You need to consider using VFP code in a VFP application.

Rick
 
malishah,

i agree with sir rick. i suggest you create your form (a.k.a. screen, window) using CREATEOBJECT() or visually. here's a sample suing CreateObject():
Code:
frmMyForm = CreateObject('Form')  [COLOR=green]&& actual creation of form[/color]
frmMyForm.Visible = .F.  [COLOR=green]&& do not display this form until all has been set[/color]
frmMyForm.Width = 750  [COLOR=green]&& Good for 800 x 600 screen resolution or above[/color]
frmMyForm.Height = 500  [COLOR=green]&& Good for 800 x 600 screen resolution or above[/color]
frmMyForm.FontName = "Book Antiqua"  [COLOR=green]&& name of the font the form will use[/color]
frmMyForm.FontSize = 10  [COLOR=green]&& size of the form's font[/color]
frmMyForm.Caption = "Sample Form"  [COLOR=green]&& title that will apear on your form[/color]
frmMyForm.AutoCenter = .t.  [COLOR=green]&& form displays at center of screen[/color]
  :
  :
[i]any other settings go here[/i]
  :
  :
frmMyForm.Visible = .T.  [COLOR=green]&& displays the form[/color]

kilroy [trooper]
philippines

"Illegitimis non carborundum!"
 
Thanks Kilroy for the code. It worked but there still exist some problem. When I run the program in VFP environment it is ok but when I run executable outside VFP, the size of window (form) is still not appropriate and the title (Menupads/poups) are also not visible. Any guidlines plz.
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top