Is there a way to adjust all the visual componets on a form programatically 
?

Then I can do something like this.

   rWidScale:=Screen.Width/fmain.Width;
   rHeiScale:=Screen.Height/fmain.Height;

   fMain.Left:=0;                                                      // 
Set  the form to full screen
   fMain.Top:=0;
   fMain.Height:=Round(fMain.Height*rHeiScale);
   fMain.Width:=Round(fMain.Width*rWidScale);

   Button1.Top:=Round(Button1.Top*rHeiScale);    //Scale each visual 
component
   Button1.Left:=Round(Button1.Left*rWidScale);
   Button1.Height:=Round(Button1.Height*rHeiScale);
   Button1.Width:=Round(Button1.Width*rWidScale);
   Button1.Font.Size:=Round(Button1.Font.Size*rHeiScale);

   DBGrid1.Top:=Round(dbGrid1.Top*rHeiScale);  /// etc
   DBGrid1.Left:=Round(dbGrid1.Left*rWidScale);
   DBGrid1.Height:=Round(dbGrid1.Height*rHeiScale);
   DBGrid1.Width:=Round(dbGrid1.Width*rWidScale);
   DBGrid1.Font.Size:=Round(dbGrid1.Font.Size*rHeiScale);

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [email protected] with 
Subject: unsubscribe

Reply via email to