关于边框拖动的问题,急!急!急! 我想问当将窗体的边框隐藏后,如何可以当在窗体范围内按住鼠标可以随意拖动该窗体,寻求代码,先谢谢了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 procedure TMain_form.Image10MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin inherited; FX := Mouse.CursorPos.X; FY := Mouse.CursorPos.Y; Timer1.Enabled := True;end;procedure TMain_form.Image10MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin inherited; Timer1.Enabled := False; end;procedure TMain_form.Timer1Timer(Sender: TObject);begin if (FLeft <> Self.Left) and (FTop <> Self.Top) then begin Self.Left := Self.Left + (Mouse.CursorPos.X - FX); Self.Top := Self.Top + (Mouse.CursorPos.Y - FY); FX := Mouse.CursorPos.X ; FY := Mouse.CursorPos.Y ; end;end;把窗体边成bsnone,然后放一个图片模仿标题,上面事件,如果你要按住窗体的话,onmouseDown和Onmouseup就直接写在窗体的里面好了Fx,Fy不是局部变量,必须是窗体变量或者是全局变量 试验成功!unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;type TForm1 = class(TForm) private { Private declarations } public { Public declarations } procedure WmNCHitTest(var Msg: TMessage); message WM_NCHITTEST; end;var Form1: TForm1;implementation{$R *.dfm}{ TForm1 }procedure TForm1.WmNCHitTest(var Msg: TMessage);begin Inherited; if Msg.Result = HTCLIENT then Msg.Result := HTCAPTION;end;end. 楼上的是可以,能实现WINDOW一样,拖动的时候出现边框,然后放下的时候窗体过去,我的可以实现,拖一点移动一点 石家庄DELPHI群:48621650 用indy做的邮件软件可以发给sina.com吗?如果可以怎么做的 关于query的问题 请教怎样在一个dbgrid中显示两个数据源的数据? delphi中ADO连接DBF的问题 今日终於星级了, 大家齐齐有分 紧急求助,我出现了:out of Memory,各位大虾帮帮忙 我想在安装程序中生成一个超级用户密码,应该怎么做? 两个简单的小问题,先答先得分哦!!! 我的报表预览正常,打印却只卷一下纸,打印就结束,打印机设置都正确! 分组报表打印?急,在线等待 做图表统计时候,为什么后面有好多的空白页啊??
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
inherited;
FX := Mouse.CursorPos.X;
FY := Mouse.CursorPos.Y;
Timer1.Enabled := True;
end;procedure TMain_form.Image10MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
inherited;
Timer1.Enabled := False;
end;procedure TMain_form.Timer1Timer(Sender: TObject);
begin
if (FLeft <> Self.Left) and (FTop <> Self.Top) then
begin
Self.Left := Self.Left + (Mouse.CursorPos.X - FX);
Self.Top := Self.Top + (Mouse.CursorPos.Y - FY);
FX := Mouse.CursorPos.X ;
FY := Mouse.CursorPos.Y ;
end;
end;把窗体边成bsnone,然后放一个图片模仿标题,上面事件,如果你要按住窗体的话,onmouseDown和Onmouseup就直接写在窗体的里面好了
Fx,Fy不是局部变量,必须是窗体变量或者是全局变量
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
procedure WmNCHitTest(var Msg: TMessage); message WM_NCHITTEST;
end;var
Form1: TForm1;implementation{$R *.dfm}{ TForm1 }procedure TForm1.WmNCHitTest(var Msg: TMessage);
begin
Inherited;
if Msg.Result = HTCLIENT then
Msg.Result := HTCAPTION;
end;end.