首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

怎么设置事件

2012-04-09 
如何设置事件?privatef:TNotifyEventproceduredotest(sender:tobject)publicendprocedurebutton1onclic

如何设置事件?
private  
      f   :   TNotifyEvent;
      procedure   dotest(sender   :   tobject);
public

end;

procedure   button1onclick(sender:   tobject)
begin
    if   getpropinfo(button2,   'onclick ')   <>   nil   then
        setXXXprop(button2,   'onclick ',   ????);
end;
-------------------------------
???代表dotest方法,目的是把方法dotest设置到button2的onclick事件上去,方法必须限制使用   setXXXprop   设置属性的方式,因为不能保证button2一定有onclick事件

[解决办法]
setXXXprop(button2, 'onclick ', dotest);

procedure setXXXprop(Button: TButton; NotifyName: String; Event:TNotifyEvent);
[解决办法]
这个?

private
procedure dotest(sender : tobject);
public

end;

procedure button1onclick(sender: tobject)
begin
button2.onclick:=dotest;
end;
[解决办法]
正解
[解决办法]
汗 月亮大哥也分小弟一点米嘛

热点排行