//Perform_程序运行时拖动组件
//那个控件必须是少状态正的组件
public
procedure AppMessage(var msg: tmsg;var handlede: boolean);
{ Public declarations }
procedure TForm1.FormCreate(Sender: TObject);
begin
application.OnMessage := AppMessage;
end;
procedure TForm1.AppMessage(var msg: tmsg; var handlede: boolean);
const
move = $f012;
begin
if msg.message = wm_mousemove then
begin
ReleaseCapture;
activecontrol.Perform(wm_syscommand,move ,0);
end
else if msg.message = wm_lbuttondown then ActiveControl := nil;
end;