Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-07-2012, 08:17 PM
delphimpd delphimpd is offline
Senior Member
 
Join Date: Oct 2006
Posts: 680
Default Form Resolution independent

Hi All and thanks for your help.

I was wondering if you guys can help me out on this code.

I used to program my Applications in Delphi 7 however a while back I updagraded to 2010. I own a copy of ElasticForm which is in charge of handeling all type of Screen resolution changes, however, ElasticForm is not compatible with 2010. I tried to contact the Component developer but no answer from her.

I found this code out there, which is suposed to take care of resolution changes and make all components inside the form resolution independant, however it is not working for me, I am sure that I am not doing things right.

Perhaps you have a better solution, or a better explanation of how to use the below code the right way.

Thanks again for your help.


Here is the code



Code:
procedure ScaleForm(F: TForm; ScreenWidth, ScreenHeight: LongInt) ;
begin
   F.Scaled := True;
   F.AutoScroll := False;
   F.Position := poScreenCenter;
   F.Font.Name := 'Arial';
   if (Screen.Width <> ScreenWidth) then begin
     F.Height :=
         LongInt(F.Height) * LongInt(Screen.Height)
         div ScreenHeight;
     F.Width :=
         LongInt(F.Width) * LongInt(Screen.Width)
         div ScreenWidth;
     F.ScaleBy(Screen.Width,ScreenWidth) ;
   end;
end;
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 11:46 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.