Auto Scaling routine...
This routine has made life very very easy. This routine will insure that your application will look scaled at ANY resolution. Notice the 640 reference. This is because I develop apps in 640x480. You can adjust the routine to work from what YOU develop in so you dont have to worry about the odd and big screen resolutions that your users may have. Place, in the OnCreate event of the form you want auto-scaled:
AdjustResolution(Self);
{ AdjustResolution ******************************************************* }
{ This procedure scales all the children on a given form to conform to the }
{ current screen resolution }
{ ************************************************************************ }
procedure AdjustResolution(oForm:TForm);
var
iPercentage:integer;
begin
if Screen.Width > 640 then
begin
iPercentage:=Round(((Screen.Width-640)/640)*100)+100;
oForm.ScaleBy(iPercentage,100);
end;
end;
|