TButton *tem=new TButton(Owner);
tem->Visible=ture;
tem->OnClick="某个点击函数“;

解决方案 »

  1.   

    ---- (1) 定义控件类型 var 
    Button1:TButton; 
      ---- (2) 生成控件 Button1:=TButton. Create(self); 
    Button1.Parent:=Self; 
    //一般将其父控件设置为Self,如果不设置Parent的值, 
    则控件不会在屏幕 
    //显示出来 
      ---- (3) 设置其它属性及定义相关事件响应函数,如Caption,Left,Top,Height,Width,Visible,Enabled,Hint和onClick事件响应函数等。 
    如:
    button1.onclick:=myclick(...);
      

  2.   

    有点跑题了,如果你的按钮的名字有一定规律比如
    "button1","button2"......"button10"
    ok,(findcomponent('button'+inttostr(i)) as Tbutton).onclick:=myclick(...)
      

  3.   

    another way like bitter:for i := 0 to ComponentCount - 1 do 
      if Components[i] is TButton then (Components[i] as TButton).OnClick = MyClick;
      

  4.   

    another way like bitter's:for i := 0 to ComponentCount - 1 do 
      if Components[i] is TButton then (Components[i] as TButton).OnClick = MyClick;