Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Define Window VFP8 vs VFP7
Message
 
To
07/02/2005 16:51:49
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
00984448
Message ID:
00984630
Views:
17
Chris,
I made some minor changes to the code you posted. The first time I ran the program I got scroll bars but every time after that the scroll bars were gone.
DEFINE WINDOW W2 AT 2,2 SIZE 40,95 TITLE "Press 'Esc' when done editing the report" NAME oW2 FONT "FOXFONT",9 NOFLOAT NOCLOSE NOMINIMIZE SYSTEM
*oW2.ScrollBars = 3 && not needed because it doesn't really do anything
MOVE WINDOW W2 CENTER
*ACTIVATE WINDOWS W2  && not needed since modi file einar.txt wind W2 will activate and display window but it doesn't hurt to keep it there
*ZOOM WINDOW W2 MAX  && not needed since you go back to norm in line below
*ZOOM WINDOW W2 NORM && not needed since I removed line above
MODI FILE einar.txt WINDOW W2 && I did not have h:\confe.txt on my computer <s>
RELEASE WINDOWS W2
Thinking more about the problem I realized that my first thought was correct and it was very simple to prove this. Run the code above (or your own code). First time (for a new text file) you will see the scroll bars. 2nd time the scroll bars will not be there.
Now increase the SIZE parameters in the program by 5 (SIZE 45,100) and run the program, this time you will see most of the scoll bars. Run the program again and the scroll bars are gone. Increase the SIZE and run again and the scroll bars are back. And so on and so forth.

The reason for this behavior is that the foxeditor remembers how big the window was the last time the editor was used (same thing with notepad (and a lot of other apps), try to open notepad and change the size very small then close notepad and then open it again and it remembers it's previous size), but somehow displaying it in a window like you do must goof it up.

A way to prove that it is the foxeditor is to run the code. Then issue modi file einar.txt from the command window and make the edit window smaller before you close the edit window, then run the code again and now the scroll bars are back.

Another way to test this is to run the code. Then issue modi file einar.txt from the command window and then right click the edit window title bar and choose properties, uncheck the Save Preferences and then run the code again. Now the scroll bars are back.

Even if I have now found the cause of the problem I must say I can't figure out how to fix it. I've got a feeling that maximizing and then restoring to normal (I commented that code out above) was an attemt to solve the problem, but it doesn't solve it in VFP8SP1.
I don't have any other version of VFP installed, but it would be interesting to find out if the maximize and then restore to normal approach works in VFP7 or below.

Einar





>DEFI WIND W2 AT 2, 2 SIZE 40,95 TITLE "Press 'Esc' when done editing the report" NAME w13 FONT "FOXFONT",9 NOFLOAT NOCLOSE NOMI SYSTEM
>
> w13.ScrollBars = 3
>
> MOVE WINDOW w2 CENTER
> ACTIVATE WINDOWS w2
> ZOOM WINDOW w2 max
> ZOOM WINDOW w2 norm
>
> MODI FILE h:\confe.txt WINDOW w2
>
> RELEASE WINDOWS w2
>
>
>here is the code that I have been running. Funny thing is if I change the w13.ScrollBars = 3 to w13.BackColor = 65535, the background is always yellow (10 for 10).
>
>Chris
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform