Board index » delphi » Control array

Control array

I have decided to switch from using VB to Delphi and have a problem; I need
to create some buttons dynamically and then have the respond to an even when
clicked. I can make the controls and set thier properties dynamically but
cannot give them an event to respond to when clicked. This used to be called
a control array in Visual Basic if it helps.

Thanks in advance Phil Jackson.

 

Re:Control array


Quote
Peter Jackson wrote:

> I have decided to switch from using VB to Delphi and have a problem; I need
> to create some buttons dynamically and then have the respond to an even when
> clicked. I can make the controls and set thier properties dynamically but
> cannot give them an event to respond to when clicked. This used to be called
> a control array in Visual Basic if it helps.

> Thanks in advance Phil Jackson.

procedure TForm1.MyEventHandler(Sender:TObject);
  begin
  end;

MyButtonArray[10].OnClick:=MyEventHandler;

Alex
--
** Pepsi Cola and animal protection **
**  http://www.pepsi{*word*76}bath.com/  **

Author of the free Chatsystem PINO! || Website: http://www.alcomp.net
Available at http://pino.cjb.net    || Chat   : pinochat.dhs.org:8080

Other Threads