Object Arrays on Forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hiya All

I would like help please on how to create an array of objects
programmatically on a form.

I have a component called "CrosswordBlock" and would like to create multiple
objects of this component an place it on a form called "Form1".

Any suggestions and examples would be appreciated.

Thanks in advance.

Edward
 
Is it a Control? If so, all you need to do is set its location and whatever
other properties it has and add it to the Controls Collection of the Form,
or the Container in the Form you want to put it in.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.
 
Hi Kevin

Yep, it's a control.

I have an idea of using, if possible, a for loop similar to the following:

for (int x = 0; x < 10; x++)
{
// Create control here
// Set control's properties here
}

Thanks!

Edward
 
Back
Top