Solved

Auto resizing forms component

Posted on 1998-08-12
3
245 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
creating threads in delphi 1 137
Delphi: ForceDirectory plain function 7 42
Delphi: Connect to running MS Outlook 4 123
Firemonkey BASS_Init into a thread 17 33
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

821 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