Ну а вообще просто прижать форму без всяких стилей и т.п. можно вот так:
| Код | unit Unit1;
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); private procedure WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); message WM_GETMINMAXINFO; procedure WMWindowPosChanging(var Message: TWMWindowPosChanging); message WM_WINDOWPOSCHANGING; procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND; end;
var Form1: TForm1;
implementation
const FormWidth = 300; FormHeight = 150;
{$R *.dfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject); begin Left := 0; Top := 0; end;
procedure TForm1.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); begin with Message.MinMaxInfo^ do begin ptMinTrackSize.X := FormWidth; ptMinTrackSize.Y := FormHeight; ptMaxTrackSize.X := FormWidth; ptMaxTrackSize.Y := FormHeight; end; inherited; end;
procedure TForm1.WMWindowPosChanging(var Message: TWMWindowPosChanging); begin with Message.WindowPos^ do begin x := 0; y := 0; cx := FormWidth; cy := FormHeight; end; inherited; end;
procedure TForm1.WMSysCommand(var Message: TWMSysCommand); begin with Message do if (CmdType and $FFF0 <> SC_MINIMIZE) and (CmdType and $FFF0 <> SC_MAXIMIZE) then inherited; end;
end.
|
Устанешь отдирать ;) |