动态生成SpeedButton组件的方法和事件 我现在需要动态生成动态生成SpeedButton组件,并且要编写所生成的SpeedButton组件的事件(Click),请大家帮助一下,写个实例,谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private procedure SpeedButton1Click(Sender: TObject); public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);var btn:TspeedButton;beginwith TspeedButton.Create(self) dobegin Caption := '请点击'; Width := 60; Height := 30; Name := 'btn1'; Parent := Self; left := 100; top:= 100; OnClick := SpeedButton1Click;end;end;procedure TForm1.SpeedButton1Click(Sender: TObject);begin ShowMessage(TSpeedButton(sender).Name +'单击!');end; 那如果已经注入到一个外部程序, 如何在外部程序现有的SpeedButton后面, 再增加一个呢? 并响应click SpeedButton后面要计算位置,最好是指定。 如果确实需要动态生成事件代码如楼说所说可以自定一些事件代码,然后等于事件,但如果你想动态生成代码,需要用于SCRIPT JAVA或其它 如何获得某个控件的所有属性? delphi treeview节点图标 悄悄抱怨一下:) !!! TSlowDBGrid是那个组件包里的组件,那里有下载。 新手求教 DBLookupComboBox 动态添加 SQL 如何使程序最前方。 不知道算不算钻牛角,但是我真的很想告明白 关于console控制台问题 注意!!!Delphi编译重载方法时可能会失误! 怎样在delphi里面新建一个excel表? 多年收集的delphi书籍,源代码奉献给大家 txt文本文档可以当数据库吗
procedure SpeedButton1Click(Sender: TObject);
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
var btn:TspeedButton;
begin
with TspeedButton.Create(self) do
begin
Caption := '请点击';
Width := 60;
Height := 30;
Name := 'btn1';
Parent := Self;
left := 100;
top:= 100;
OnClick := SpeedButton1Click;
end;end;procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
ShowMessage(TSpeedButton(sender).Name +'单击!');
end;
如楼说所说可以自定一些事件代码,然后等于事件,
但如果你想动态生成代码,需要用于SCRIPT JAVA或其它