unitfrmmain.pas

来自「DELPHI7编程百例 DELPHI7编程百例 DELPHI7编程百例」· PAS 代码 · 共 43 行

PAS
43
字号
unit unitFrmMain;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TForm1 = class(TForm)
  private
    { Private declarations }
    procedure WMMOVE(var Msg: TMessage); message WM_MOVE;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

{ TForm1 }

procedure TForm1.WMMOVE(var Msg: TMessage);
begin
  begin
    inherited;
    if (Left < 10) and (Top < 10) and
      (Left <> 0) and (Top <> 0) then // 设定移动到左上角 10 点范围内时贴到边上去
      begin
        Left := 0;
        Top := 0;
        Msg.Result := 0;
      end;
  end;

end;

end.

 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?