Mega Code Archive

 
Categories / Delphi / Examples
 

Ensuring correct font display under all screen resolutions

If you have developed your program using Delphi's default settings and then started it on a Computer running in a different Screen resolution, you will already know that this can turn out to a problem causing not only short headaches. But here is the solution that should fix your problems: Design on large fonts, use only truetype fonts, set the forms Scaled property to false. That works pretty well on smallfont systems. You just have to make sure that your form does not become larger than the users screen size. This can be handled by a simple check in the forms OnCreate procedure, call SystemparametersInfo( SPI_GETWORKAREA, 0, @aRect, 0 ); Check if your forms width or height exceed the dimensions of aRect, if so you set your forms Boundsrect := aRect; and the forms AutoScroll property to true. It then gets scrollbars but that is