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);
  if (Form2 <> NIL) then
    form2.SetBounds(message.XPOs + Width,message.YPOs + Height, Form2.Width, 

Works here.

Christopher Crowe (Software Developer)
Microsoft MVP, MCP

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

> -----Original Message-----
> 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,
> 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:

    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]

Reply via email to