问题已解决。拿来大家看看:
(还是给分)(太容易了吧)
unit U_FormFloat;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls;
type
TFormFloat = class(TForm)
Panel1: TPanel;
procedure FormCreate(Sender: TObject);
procedure FormDragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
procedure CreateParams(var Params:TCreateParams);override;
end;
var
FormFloat: TFormFloat;
implementation
{$R *.DFM}
procedure TFormFloat.FormCreate(Sender: TObject);
begin
Width := 72;
Height := 36;
SetWindowLong(Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
end;
procedure TFormFloat.CreateParams(var Params:TCreateParams);
begin
inherited;
with Params do
begin
Style := Params.Style xor WS_DLGFRAME;
WndParent := 0;
end;
end;
procedure TFormFloat.FormDragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
begin
Accept:=True;
end;
procedure TFormFloat.Panel1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
const
SC_DragMove = $F012; { a magic number }
begin
ReleaseCapture;
FormFloat.Perform(WM_SysCommand, SC_DragMove, 0);
end;
end.