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

Window displaying differently outside VFP environment

SitesMasstec

Programmer
Sep 26, 2010
566
Brasil
Hello colleagues!

I defined a window to appear in some circunstances during a program execution:
Code:
DEFINE WINDOW JanelaAviso IN SCREEN;
    FROM 10,10 TO 26,110;
    FONT 'Courier New',11;
    STYLE 'B';
    COLOR RGB(51,51,51,  &AmareloClaro), RGB(0,0,0,  255,255,255)

When I run a program in the VFP environment, the window shows:
JanelaAvisoVFPenviron.JPG

But when I build the EXE and run it, the window is redimensioned and the text are in different positions:
JanelaAvisoVFPexe.JPG

What is wrong?

Thank you.
 
As a rule of thumb, I don't define windows using absolute coordinates for both dimensions, especially when they're on the screen because the FROM and TO coordinates are dependent on the font size of the screen itself.

So, to ensure the window is large enough for whatever you are putting into it using the font and size you specified, use FROM (coordinates) SIZE (rows/columns needed).

For what it's worth, I also avoid using coordinates for the FROM clause whenever possible by either using 0,0 then moving the window center (MOVE WINDOW MyWindow CENTER), or by using system variables like SROWS() / 2 to put the top of window at about the middle of the screen.
 
Why not just create a form for this? Then it should look the same regardless of the environment.
I agree, if it's a new project, so I assume he is trying to just maintain something written before Windows, so there are a bunch of @ SAY/GET or ? lines.

As for me, I still define Windows from time to time when I want a BROWSE window or a REPORT FORM to take up a specific space.
 
Arrayname and Joe: Yes, I will follow your advice.

Really, form is more convenient, as we cannot preview the resolution/size of the user's screen.

Thank you.
 
Dylim:

My Window Display Settings is 1366 x 768 , Scale 100%.

But other users may have this setting at 1280 x 720, or 1024 x 768...
 
Dylim:

My Window Display Settings is 1366 x 768 , Scale 100%.

But other users may have this setting at 1280 x 720, or 1024 x 768...
Since every user can have different screen dimensions and resolutions, it's best to design user interfaces with forms and avoid absolute screen coordinates entirely.

Forms can make things quite a bit easier, but we still need to be mindful of whether they will fit on a user's screen and what position they will use.
 

Part and Inventory Search

Sponsor

Back
Top