Link to home
Start Free TrialLog in
Avatar of avinash_takale
avinash_takale

asked on

how to control array in C#

Hi Experts,

Is it pssible to create control array viz picture box, just like VB.


thanks in adance.
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

you can create an Array of controls - in fact you cancreate an array of 'anything' - an array of Object

but this is NOT the same thing as a VB 6 style Control Array -  .NET does NOT support control arrays in the same way that VB 6 did.

AW
Avatar of aaronfeng
aaronfeng

Do something like this:

// if you want array of buttons
Control[] controls = new Controls[10];
for(int i = 0; i < 10; i++) controls[i] = new Button();

Cheers,

Aaron
http://aaronfeng.blogspot.com/
ASKER CERTIFIED SOLUTION
Avatar of HeidarV
HeidarV

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial