Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Large Size (120 DPI)

Posted on 2007-03-17
10
469 Views
Last Modified: 2010-04-05
My Application is designed in Normal Size(96 DPI). But when it is run under Large Size(120 DPI), It has problems. I can set the Scaled property of a form to False, which prevents it from being resized, but the writing on different controls on the form gets enlarged.
1) How do I make the writings on the controls(for example buttons) stay the same?
2)  There is a PageControl on the main form with 11 tab sheets. How do I prevent them from getting onto two lines and staying the same size.
0
Comment
Question by:QurbanDurrani
  • 5
  • 5
10 Comments
 
LVL 17

Expert Comment

by:mokule
ID: 18742059
Have You tried to set
ParentFont := False;
for these controls?
0
 

Author Comment

by:QurbanDurrani
ID: 18742605
Mokule,
The parent font for these controls and the form itself is set to false. Still Same problem.
0
 
LVL 17

Expert Comment

by:mokule
ID: 18743030
try to set font size for the controls this way

var
  DesiredSize: integer;
begin
  DesiredSize := 8;
  Button1.Font.Size := MulDiv(DesiredSize,96,PixelsPerInch);
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Author Comment

by:QurbanDurrani
ID: 18744308
Mokule,
Yes I have set the parent font for both the control and the form that contains them to false, but still same problem.
0
 
LVL 17

Expert Comment

by:mokule
ID: 18744455
Yes, but what about my another suggestion?
0
 

Author Comment

by:QurbanDurrani
ID: 18745056
Mokule,
I tried putting the code as shown below in both the 'formcreate' and the 'formshow' procedures, but neither fixed the problem.
var
DesiredSize: integer;
begin
DesiredSize := 8;
  P1TypeLabel.Font.Size := MulDiv(DesiredSize,96,PixelsPerInch);
0
 
LVL 17

Expert Comment

by:mokule
ID: 18745148
What are you font name?
try with
  Button1.Font.Name := 'Arial';
0
 

Author Comment

by:QurbanDurrani
ID: 18745406
The font name is 'MS Sans Serif'
Changing it to 'Arial' in code did the trick.
Why did it not work with 'MS Sans Serif'?
How do I check to see if DPI setting is 120 (or not 96) before I change the name and size?
Thanks for your help so far, it got me much further than I was.
0
 
LVL 17

Accepted Solution

by:
mokule earned 500 total points
ID: 18745646
It doesn't work with 'MS Sans Serif' because it's not true type font.
It's harder to achieve scaling not true type fonts.
They have only limited sizes values.
Look into Fonts Folder in Control Panal to see the difference between these fonts.

You should read PixelsPerInch property to verify DPI
0
 

Author Comment

by:QurbanDurrani
ID: 18749941
It works. Thanks for your help.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question