我在form1上动态创建了一个button1 怎样在程序运行的时候可以托动 button1来改变button1的位置???
解决方案 »
- 有没好办法在打开窗体后就能看到所有记录,且不影响窗体打开速度?
- FastReport2.47最近突然把Object Inspector给弄丢了,死活找不回来了,toolbar里已经选择了!苦啊!
- 一个关于16进制转ASCII码的问题
- 关于Delphi对Vcl和自定义组件的跟踪!郁闷中.....
- delphi2010中clientdataset的field name missing
- 请问对于数量大的记录集如何提高插入纪录的速度?
- 请问用RAR命令行参数能不能压缩成ZIP,谁有好的压缩控件也行,急在线等待!!!!
- 关于猫的问题,,,,大哥行行好啊!!!!!!!!!!!!!!
- 请问什么是匈牙利命名法?
- ActiveX Form问题,无法使用键盘上的箭头来移动记录?
- 在线等,请问DELPHI中怎样修改应用程序的图标
- fastreport做一个master/detail报表
begin
with TButton.Create(Self) do begin
Parent := Self;
OnMouseDown := ButtonMouseDown;
Caption := '测试看看,这方法很古老';
end;
end;procedure TForm1.ButtonMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
TControl(Sender).Perform(WM_SYSCOMMAND, SC_MOVE or 1, 0);
end;
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TmyButton=class(tbutton)
private
procedure NcHitTest(var msg:tmessage);message wm_nchittest;
end; TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
with tmybutton.Create(self) do
begin
parent:=self;
caption:= 'Haha, drag me';
end;
end;{ TmyButton }procedure TmyButton.NcHitTest(var msg: tmessage);
begin
msg.Result := HTCAPTION;
end;
end.
to: zswang(伴水)(流浪在北京), 你还是第一次回答我的问题, 多帮帮兄弟哦!!