Windows with Delphi Windows API (94) Windows Filesystem (41) Windows Forms (69) Windows Graphics (38)
Exchange Links About this site Links to us 
|
How to make a form non-moveable
This article has not been rated yet. After reading, feel free to leave comments and rate it.
It is easy to make a form non-moveable.
Choose a borderstyle like bsDialog so that the window can not be resized.
Then add an handler for the WM_WINDOWPOSCHANGING message and override the change.
 | |  | | type
TMyForm = class(TForm)
protected
procedure OnPosChange(var Msg: TWmWindowPosChanging);
message WM_WINDOWPOSCHANGING;
end;
procedure TForm1.OnPosChange (var Msg: TWmWindowPosChanging);
begin
Msg.WindowPos.x := Left;
Msg.WindowPos.y := Top;
Msg.Result := 0;
end;
| |  | |  |
Comments:
|