>>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.