本文整理自网络,侵删。
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormShow(Sender: TObject);
protected
procedure WMMove(var Message: TWMMove); message WM_MOVE;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
var a,b: Integer;
procedure TForm1.WMMove(var Message: TWMMove);
begin
if Assigned(Form2) then
begin
Form2.Left := Left + a;
Form2.Top := Top + b;
end;
inherited;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
Form2.Show;
Form2.Left := Left+Width;
Form2.Top := Top;
a := Form2.Left - Left;
b := Form2.Top - Top;
end;
end.
相关阅读 >>
Delphi 10 seattle中使用本地通知,请使用tnotificationcenter组件
Delphi windows 编程[18] - 更换菜单项: modifymenu
更多相关阅读请进入《Delphi》频道 >>