Solved

Auto resizing forms component

Posted on 1998-08-12
3
248 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
[X]
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
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month4 days, 12 hours left to enroll

635 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