Uses
Windows;
type
TForm1 = class(TForm)
protected
procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST;
end;procedure TForm1.WMNCHitTest(var Message: TWMNCHitTest);
begin
inherited; with Message do
if Result = HTCAPTION then
Result := HTNOWHERE;
end;
Windows;
type
TForm1 = class(TForm)
protected
procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST;
end;procedure TForm1.WMNCHitTest(var Message: TWMNCHitTest);
begin
inherited; with Message do
if Result = HTCAPTION then
Result := HTNOWHERE;
end;
private
{ Private declarations }
procedure WMMoving(var Msg: TMessage); message WM_MOVING;
public
{ Public declarations }
end;procedure TForm1.WMMoving(var Msg: TMessage);
var
P: PRect;
begin
inherited; P := PRect(Msg.LParam);
P^.Left := 0;
P^.Top := 0;
P^.Right := 640;
P^.Bottom := 480;
end;
设置窗体borderstyle属性为bsnone