Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to handle different screen size

Status
Not open for further replies.

johan3000

MIS
Dec 17, 2010
18
ID
Hi All,

If the window screen could be one of :
800x600
1024x768
1280x768

1. Then how to write the code to get the current screen size and determined the grid, row, fontsize in that form ?

2. how to max the window/form size ?

3. if the screen size is bigger, then allow the user to change the font size in the grid.

4. Is it possible to do something like ZOOM (+/-) the worksheet like the one in the Ms Office 2007

thanks so much
 
To get the size of the screen, use SYSMETRIC(1) and SYSMETRIC(2).

However, you don't really need to do that. If you want the form to fill the screen, set its WindowState property to 2.

You would then need to adjust the sizes and positions of the controls within the form. You can do that, as Mark Twain says, by using a bit of freeware called mwResize50, but it's much easier just to set the Anchor properties.

If you are using an old version of VFP (which doesn't have Anchor), you can do it by calculating the positions and sizes of each of the controls, and then adjusting the Top, Height, Left and Width properties accordingly.

To change the font size of a grid, set its Fontsize property.

To zoom the "worksheet" - what worksheet? And what do you mean by zoom? In general, if you want to change the font size of a control, change its Fontszie.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
thanks bro markftwain mwResize50 work perfectly.

thanks bro MikeLewis (Programmer) Anchor is the solution.'


here is the posting og bro danfreeman, also very useful


danfreeman (Programmer)
22 Jan 11 1:15
What version of VFP?

If it's VFP9, explore .Anchor on each control. Then, in the form's init, set .top=0, .left=0, .height=_screen.height and .width=_Screen.width


thanks all, have a nice day..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top