Try

In the main form in the Protected/Public Declaration put

procedure WMMove(Var Message : TWMMove); message WM_MOVE;

Then on the main form

procedure TForm1.WMMove(Var Message : TWMMove);
begin
  if (Form2 <> NIL) then
    form2.SetBounds(message.XPOs + Width,message.YPOs + Height, Form2.Width, 
form2.Height);
end;

Works here.


Christopher Crowe (Software Developer)
Microsoft MVP, MCP

Byte Computer & Software LTD
P.O Box 13-155 
Christchurch
New Zealand
Phone/Fax (NZ) 03-3651-112


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Alistair George
> Sent: Tuesday, 6 April 1999 10:07
> To: Multiple recipients of list delphi
> Subject: [DUG]: Mainform move
> 
> 
> This should be a piece of cake, but I cant find any way to detect the
> movement of a mainform apart from using a messy movedhoriz:=Mainform.left,
> movedvert:=mainform.top to locate the windows position, then check it
> against the values from time to time.
> Theres gotta be a better way??
> 
> Whats happenin is that when my mainform is moved by clicking and 
> moving the
> caption bar, a child panel is being left behind, so when the mainform is
> moved, the child panel needs to be repainted.
> Thanks,
> Alistair+
> 
> ------------------------------------------------------------------
> ---------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> 

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to