比如说form1.buttonOnclick(sender:Tobject)
那么说sender就是button经常有这样的用法
if sender=button then
.........
那么说sender就是button经常有这样的用法
if sender=button then
.........
解决方案 »
- 打包一个软件,并去广告 200块是否有人可以拿下?
- 【请教】关于DBGrid的问题!在线等!
- active form生成OCX后发布问题?
- DRDWG50Lib_TLB.pas是什么控件包含的文件。
- KKK~~~数据库中能不能直接读查询结果的一列,或是一行
- 如何在c/s结构中,客户端如何取得服务器的系统时间
- 各位老大,拜托: 为什么在Delphi中用PasteSpecial会使目标ppt体积剧增?
- SQL的问题
- 有没有方法,当检测到与internet连通时,立刻启动我的程序
- adotable1['quan1']:=strtoint(adodataset1['quan1']),quan为字符请问为何不成立.
- 怎么将程序最小化到系统托盘
- 在delphi 里面的sql语句 如何实现按日期查询?
你可以跟到VCL中看一下。 注意FOnClick的参数,就是Self
procedure TControl.Click;
begin
{ Call OnClick if assigned and not equal to associated action's OnExecute.
If associated action's OnExecute assigned then call it, otherwise, call
OnClick. }
if Assigned(FOnClick) and (Action <> nil) and (@FOnClick <> @Action.OnExecute) then
FOnClick(Self)
else if not (csDesigning in ComponentState) and (ActionLink <> nil) then
ActionLink.Execute
else if Assigned(FOnClick) then
FOnClick(Self);
end;
showmessage((Sender as Tbutton).name);
然后是其余几个button的onclick事件都指向刚才的button 的onclick事件(每个button的onclick属性页那里点一下,就有一个下拉列表就会出现刚才所写的onclick事件过程,选中即可)
运行程序,按不同的按钮看有什么结果。