Mike, actually, I would stay away from ActiveForm.  I originally used this
for all sorts of neat things... but its unreliable in that it may not work
for you all the time.  For example you pop a dialog box to ask the prompt
the user before calling thsi code... and hey presto, your active form isnt
what you thought it was.

I would use Sender as TWinControl

----- Original Message -----
From: "Mike Osborne" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Tuesday, 24 April 2001 14:11
Subject: Re: [DUG]: New Tack - basic question


> > Try Screen.ActiveForm.
>
> Bingo. Thanks.
>
> >
> > I put the following code into a form that can be created from many
> different
> > forms so that it shows up centered inside the
> > form from which the create originated.
> >
> > procedure TfrmNotes.FormShow(Sender: TObject);
> > var
> >     T,L,H,W : integer;
> > begin
> >   with ???????? do begin
> >        T := Top;
> >        L := Left;
> >        H := Height;
> >        W := Width;
> >   end;
> >   Top := T + (H div 2) - Height div 2;
> >   Left := L + (W Div 2) - Width div 2;
> > end;
> >
> > Is there a generic entry I can replace the ?????????? with that
identifies
> > the form from which the create originated?
> >
>
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to