Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
Form scaling and the large fonts/small fonts issue Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
23-Aug-02
Category
Win API
Language
Delphi 2.x
Views
61
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			 Author: Tomas Rutkauskas

The Form of my application displays properly at all screen resolution settings, but 
if the user selects "Large fonts" in the Windows Display settings, the Form is 
truncated. How can I handle this better?

Answer:

This is usually a problem of large fonts (120 dpi) vs small fonts (96 dpi) 
settings. The user can change these settings as part of the display options in 
control panel. You can check the settings at run-time by looking at 
Screen.PixelsPerInch. 
Different ways have been suggested to create forms that will work well on both 
settings. The most important one is to use TrueType fonts (like Arial) only in your 
forms. Ms SansSerif, the default, is TT on NT but not on Win9x! 
Option 1:
Design on small fonts, leave the forms Scaled property set to true, set forms 
AutoScroll to false, leave a little extra space between controls so they can grow a 
bit under large fonts without colliding with each other. This is said to be the 
method Borland uses for the Delphi IDE itself. When you test on large fonts *never* 
save the project there! If you save such a form under large fonts it will become 
distorted under small fonts! 
Option 2:
Design on large fonts and set Scaled to false. Again take care never to save the 
project under small fonts or the forms will become distorted. 
A final issue you may need to take care of is the users screen size (in pixels). If 
you design your forms to run well on 800*600 the user will have a problem if he is 
running 640*480. So your forms should check the screen size (Screen.Width, 
Screen.Height) in their OnCreate handler. 
If the screen is too small for the form the form should resize itself to the screen size (or better the work area size, see SystemParametersInfo(SPI_GETWORKAREA) and set its AutoScroll property to true. It will then automatically sprout scrollbars, so the user can at least access all parts of the form. Trying to rescale the form to the smaller screen size will almost never result in a usable form, so I don't consider this an option.

			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC