Link to home
Start Free TrialLog in
Avatar of okemoto
okemoto

asked on

Auto resizing forms component

Anybody can provide me with a freeware component that will autosize the forms under different screen resolutions?
Avatar of erajoj
erajoj
Flag of Sweden image

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

/// John
Avatar of Matvey
Matvey

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?!!
ASKER CERTIFIED SOLUTION
Avatar of oberdan
oberdan

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