Ver Mensaje Individual
  #5  
Antiguo 31-05-2010
FENIXadr FENIXadr is offline
Miembro
 
Registrado: may 2010
Ubicación: Córdoba - Cba. - Argentina
Posts: 104
Reputación: 17
FENIXadr Va por buen camino
Mover Varias Ventanas a la Vez

Muchas Gracias Neftali.. voy a bajar tu ejemplo para verlo... te comento que realice el método que me dijo coso y no es exactamente lo que tenía en mente, o sea, la segunda ventana se mueve a una posicion con respecto a la primera, pero cuando suelto el boton..
de todos modos seguí renegando y encontré algunas cosas que no eran para este fin pero lo pude adaptar y anda perfectamente ...

acá les dejo el código de dos métodos para los que tengan el mismo problema que yo...

Método 1:
Código Delphi [-]
....
....
var  
   XX, YY : Intgeger;
   ButtonPress : Boolean;
   CursorPos : TPoint;
....
...
Procedure TForm1.FormMouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  XX := X;
  YY := Y;

  ButtonPress := True;
end;



Procedure TForm2.FormMouseMove (Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  if ButtonPress then
  begin
    GetCursorPos (CursorPos);
    Top := CursorPos.Y - YY;
    Left := CursorPos.X - XX;

    OtroForm.Top := Top + Height;
    OtroForrm.Left := Left
  end;
end;



Procedure TForm1.FormMouseUp (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  ButtonPress := False;
end;


Método 2: Escrito por Roman en alguna oportunidad.
Código Delphi [-]
interface

type
  TForm1 = class(TForm)
  private
    procedure WMMove(var Message: TWMMove); message WM_MOVE;
  end;

implementation

procedure TForm1.WMMove(var Message: TWMMove);
begin
  inherited;
  if Assigned(Form2) then
  begin
    Form2.Left := Left;
    Form2.Top := Top + Height;
  end;
end;

end.

Última edición por FENIXadr fecha: 31-05-2010 a las 14:59:26. Razón: me equivoque .. no es "roman" quien me paso el metodo que no funcionaba como yo queria es "coso"
Responder Con Cita