Solved

Auto resizing forms component

Posted on 1998-08-12
3
240 Views
Last Modified: 2010-04-04
Anybody can provide me with a freeware component that will autosize the forms under different screen resolutions?
0
Comment
Question by:okemoto
3 Comments
 
LVL 4

Expert Comment

by:erajoj
ID: 1361968
Why do you need a component?
In the form's create just add:
  with Screen do SetBounds( 0, 0, Width, Height );

/// John
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1361969
It's really simple to make a thing like this. You get the original screen resolution and your form sizes, and then calculate it this way:

rateX := OldResolutionX/getdevicecaps(GetWindowDC(GetDeskTopWindow), LOGPIXELSX);
rateY := OldResolutionY/getdevicecaps(GetWindowDC(GetDeskTopWindow), LOGPIXELSY);
NewWidth := OldWidth*rateX;
NewHeight := OldHeight*rateY;

-It calculates the proportion of the old resolution and the new. This way you can resize all controls on your form to look the same as in the original screen resolution.
Sorry, but I didn't find a component. I remember that there are such component though, but where are they when you need them?!!
0
 

Accepted Solution

by:
oberdan earned 50 total points
ID: 1361970
Try to scale your form like:

Form1.Width  := Screen.Widht div 2;
Form1.Height := Screen.Height div 2;

(or another size)

and to rescale the components in form use the ScaleBy method. It will resize the components from one proportion like 75% or 50% of form size.

Sorry the bad english.

                              []'s

                                         Oberdan
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now