Link to home
Start Free TrialLog in
Avatar of QurbanDurrani
QurbanDurrani

asked on

Large Size (120 DPI)

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.
Avatar of mokule
mokule
Flag of Poland image

Have You tried to set
ParentFont := False;
for these controls?
Avatar of QurbanDurrani
QurbanDurrani

ASKER

Mokule,
The parent font for these controls and the form itself is set to false. Still Same problem.
try to set font size for the controls this way

var
  DesiredSize: integer;
begin
  DesiredSize := 8;
  Button1.Font.Size := MulDiv(DesiredSize,96,PixelsPerInch);
Mokule,
Yes I have set the parent font for both the control and the form that contains them to false, but still same problem.
Yes, but what about my another suggestion?
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);
What are you font name?
try with
  Button1.Font.Name := 'Arial';
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.
ASKER CERTIFIED SOLUTION
Avatar of mokule
mokule
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It works. Thanks for your help.