Archived

This topic is now archived and is closed to further replies.

Xorcist

Delphi Control Array (How do I do it?)

Recommended Posts

Those of you that have dabbled in VB must know what a control array is, for those of you that haven''t it''s basically an indexed set of like-controls with a common set of event handlers. For instance button[1], button[2], and button[3] would all have a common click event, in which you could determine the index of the pressed button and react accordingly. Is there a way to do this in Delphi? Or is there a way to implement it? I know I can assign a common event handler to each button and check a preset tag value, but that doesn''t give me a way to index the controls. I need to be able to loop through the entire set of buttons each time one is pushed (is there a way to accomplish this?). Any advice would be appreciated. P.S. I heard there was a TControlArray component floating around a while back, but I have yet to run across it. (Anyone know anything about this?)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Check out TComponent

start with

properties
ComponentCount
Components[]

methods
FindComponent

/ freeman

Share this post


Link to post
Share on other sites