public class ButtonArray : System.Collections.CollectionBase
It has methods to add and delete buttons and handles clicks, etc.
Works fine as is in a form.
I would like to add this to Controls.AddRange of FlowLayoutPanel which
expects Array of Control. How do I convert ButtonArray to Control
Array? Do I add ICollection and implement CopyTo? Or is there a
simpler solution?
Syntax example is greatly appreciated. Thanks.
Sorry, only VB.Net, but you'll get the point:
Dim o As New ButtonArray
'...
Controls.AddRange(o.Cast(Of Control)().ToArray())
--
Armin
That did it. Here is the c#.
Controls.AddRange(o.Cast<Control>().ToArray())
Thanks again.