Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Saving & Retrieving VFP Form positions
Message
From
14/05/2002 12:36:46
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00655670
Message ID:
00656242
Views:
14
>>Saving & Retrieving VFP Form positions in Windows 2000
>>
>>
>>Does anyone have a recommended way of saving the final position of each VFP form and automatically opening it at that position next time it is called?
>>
>>I used to have API routines that did this in Windows 95 but, as you would expect, they don't appear to work for Windows 2000.
>
>Stephen,
>The easiest way (IMO) is to have a preferences table. In the Init of your form, you make a call to a RestorePreferences method. This method looks in the preferences table for Top, Left, Height and Width for the current form. If found, it sets the appropriate properties. The settings could be saved by calling the SavePreferences method from the Destroy method of the form.

And just my personal preference here: instead of setting the four properties one by one, I rather call thisform.move(nTop, nLeft, nHeight, nWidth). The resize event happens only once, so if there's some code there, it gets executed only once.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform