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
I've tried fMain.scaleby(120,120);
But nothing happens. Tried a button, panel but non change size. Is there something i need to activate? Scaled is set to true. Delphi 6
Hi Sorry, never worked for me neither.
Anyway, few years ago I started getting feedback about problems with some resolutions. Not all components would fit into window. I added this line to every formcreate and I haven't had problems since. (D7/D2006)
if pixelsperinch>120 then scaleby(120,120);
After trying heaps of options with ScaleBy and nothing happening, I finally found a tutorial on the web which showed my the error .
You would think that M and D would be height and width, but no, M is new and D is original. If you want to scale something by 20% you enter ScaleBy(120,100) or ScaleBy(60,50) or (30,25) Make sense. Unless you are smoking the same weed as the Delphi developers are, it won't. Now read the help ? Any better - No.
If some one is not intelligent enough to program ScaleBy(Round(NewSize/OldSize)) then they should be banned from using Delphi.
Saying all that, ScaleBy only does panels and other static bits. It does not do DBGrids. For that you really have no option left other than recoding each page with each grid for each screen resolution.
You would thinks that a 10 + year old and very expensive developmemnt package would cater for different resolutions but no.
I've tried 3 third party scaling packages and all have issues.
Hopefully I'm not on the wrong path but this works well enough.
Is there a way to take all visible elements on a form and apply a scaling factor programatically instead of one by one as below?
|All times are GMT. The time now is 07:50 AM.|
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2015, vBulletin Solutions, Inc.