Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Restoring Form Sizes ect.
Message
From
01/07/1999 16:40:58
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Restoring Form Sizes ect.
Miscellaneous
Thread ID:
00236704
Message ID:
00236704
Views:
47
I have an Custom Class object on my form classes called SaveState. It saves the form positions as well the last record and order for the next use. Anyway, in the destroy of the savestate it Save the WindowState Property, then sets the windowstate to '0', then saves the left, top, hieght, and width. So the neext time around in the Init it sets the left, top, hieght, and width, then It will set the WindowState. That way if the form is at a non-default size the user Maximizes and closes it, when he brings it up again it will be maximzed and then he restores it (un-Maximizes it) it will be where he had it last. I imagine this is pretty standard.

But the thing is during the Init and Destroy the form is not visible and things fall apart at this point. So I have to do Thisform.Visible = .T. for it to work but it looks sloppy. Even when I change the LockScreen Property back and forth. Does anybody have a Work around for this?

Also, The oApp.OpenForm Method in the Framework I'm using does the form then determines the toolbar class from some properties, and runs the toolbar. This changes the available space for the form. So when something like AutoCenter Positions the form then the toolbar pops up the form isn't centered and may or may not be 100% visible. So in the OpenForm after it loads the toolbar I check if the Savestate is present on my form, then it does: thisform.autocenter=thisform.autocenter.
And this works.

But if the form loads up Maximized and the Toolbar and oves my form down "thisform.windowstate=thisform.windowstate" won't fix it. But saving the State, setting it to normal then restoring the saved state will. Once again, sloppy.

Thanks for reading my novel, but any advice will be appreciated.
Mike Helland
Reply
Map
View

Click here to load this message in the networking platform