处理窗口的WM_MOVEunit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure WMMove(var msg:TWMMove);message WM_MOVE;
public
{ Public declarations }
end;var
Form1: TForm1;implementationuses Unit2;{$R *.dfm}procedure TForm1.WMMove(var msg: TWMMove);
begin
inherited;
if Assigned(Form2) then
if Form2.Visible then begin
Form2.Left:=Left+Width;
Form2.Top:=Top;
end;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.Show;
end;end.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure WMMove(var msg:TWMMove);message WM_MOVE;
public
{ Public declarations }
end;var
Form1: TForm1;implementationuses Unit2;{$R *.dfm}procedure TForm1.WMMove(var msg: TWMMove);
begin
inherited;
if Assigned(Form2) then
if Form2.Visible then begin
Form2.Left:=Left+Width;
Form2.Top:=Top;
end;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.Show;
end;end.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货