A r t i c l e s
Navigation

Note: This Wiki is
outdated, personal views
may have changed.
L505 A.I. bot is dead
long live THX 1138

M a i n P a g e

D i r e c t o r y

Capture Delphi Form OnMove Event


You can capture when a form moves very easily, if your version of delphi does not include an OnMove event for your Form.
type
  TForm1 = class(TForm)
  private
    procedure OnMove(var Msg: TWMMove); message WM_MOVE;

  protected

  public

  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.OnMove(var Msg: TWMMove);
begin
  inherited;
  // to show that it works
  caption:= 'Moved! Left: ' + inttostr(left);
end;

For even more code clarity, you might want to make your own derived class for a custom form. That way you won't have to place the above code in each of your programs that you want to capture form movement.

About
Note: This Wiki is outdated, personal views may have changed.

This wiki contains info on life, health, humans, nature, programming, database, fads, paradigms, poems, principles, theories.

Articles may contain statements which some may find helpful and encouraging, or even discouraging.

Beware, I believe in the Grand Justice system.
_ _ _