Path: wn8!attworldnet!wn3feed!135.173.83.25!wn4feed!worldnet.att.net!128.230.129.106!news.maxwell.syr.edu!newsfeed1.earthlink.net!nntp.earthlink.net!posted-from-earthlink!not-for-mail From: "Elena" Newsgroups: comp.lang.pascal.delphi.components.misc Subject: Re: Form resolution X-Priority: 3 X-MSMail-Priority: Normal Date: Fri, 19 Mar 1999 09:37:10 -0500 References: <7cl60t$26b$1@platane.wanadoo.fr> X-Posted-Path-Was: not-for-mail MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Content-Transfer-Encoding: quoted-printable X-ELN-Date: 19 Mar 1999 14:23:24 GMT X-ELN-Insert-Date: Fri Mar 19 06:25:10 1999 Organization: EarthLink Network, Inc. X-Newsreader: Microsoft Outlook Express 4.72.3155.0 Lines: 49 NNTP-Posting-Host: sdn-ar-001paphilp250.dialsprint.net Message-ID: <7ctmks$p0h$1@holly.prod.itd.earthlink.net> Xref: wn8 comp.lang.pascal.delphi.components.misc:18697 procedure TMainForm.ResizeToFullScreen; var c: TComponent; theLeft, theTop, theHeight, theWidth, theSize: Longint; i: integer; theRatio: Double; begin theRatio:=3DScreen.Width/Self.Width; Self.Width:=3DScreen.Width; Self.Height:=3DScreen.Height; Left:=3D0; Top:=3D0; {if you don't need resize to full screen, use other way to calculate theRatio} for i:=3D0 to ComponentCount-1 do begin c:=3DComponents[i]; if (c is TControl) then begin theLeft:=3DRound((c as TControl).Left*theRatio); theTop:=3DRound((c as TControl).Top*theRatio); theHeight:=3DRound((c as TControl).Height*theRatio); theWidth:=3DRound((c as TControl).Width*theRatio); (c as TControl).Left:=3DtheLeft; (c as TControl).Top:=3DtheTop; (c as TControl).Height:=3DtheHeight; (c as TControl).Width:=3DtheWidth; if (c is TEdit) then begin theSize:=3D(c as TEdit).Font.Size; theSize:=3DRound(theSize*theRatio); (c as TEdit).Font.Size:=3DtheSize; end; { and the same procedure for other Form Components} end; end; end; Ivan Fontaine wrote in message <7cl60t$26b$1@platane.wanadoo.fr>... > >Hi! >I would like to have my Forms automatically resized according to my = screen >properties (800x600 or 1024x768 or ..., small or large font). >What can I do ? > >Thanks in advance