Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adjusting Screen Size
Message
From
22/08/2004 12:31:49
 
 
To
16/08/2004 09:46:34
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00933527
Message ID:
00935329
Views:
19
Hi Jeffrey.

Is there a way programmatically to adjust an application screens/forms based off the users machine?

As I recall, you do have a copy of 1001 Things You Wanted to Know About Visual FoxPro

Check out Chapter 11:

How do I make my forms fill the entire screen regardless of the screen resolution? (Example: CH11.VCX::FrmMaximize and Maximize.scx)

If the application you are building is sovereign, (i.e. an application intended to be used exclusively by a user, as opposed to merely sharing a portion of the user's screen with other applications) you will probably want the forms to maximize themselves when instantiated, regardless of the screen resolution a particular user has set.

To do this you will need to calculate the ratio by which the current screen resolution differs from the standard (which should always be 640 x 480 anyway!) for which your forms are designed. This ratio can then be applied to all forms and their controls to resize everything without changing relative proportions. This is best accomplished by adding a ResizeControls method to the form class and calling it from the form's Init method, after first re-sizing the form itself, like so:

How do I create resizable forms? (Example: CH11.VCX::cusResizer and Resize.scx)

The self-maximizing form class discussed above is a special case of a re-sizable form, in that it is a once-only operation, but the basic principles are the same. Each time the form is resized, we need to calculate the ratio by which the form's height and width have changed relative to its original dimensions and then apply that ratio to each control on the form to retain the same relative size and positions at all times.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform