By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,961 Members | 1,320 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,961 IT Pros & Developers. It's quick & easy.

Object Arrays on Forms

P: n/a
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
Mar 18 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
PS: I'm using Visual Studio .NET 2005 and the C# language.

"Edward" wrote:
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

Mar 18 '06 #2

P: n/a
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.

"Edward" <Ed****@discussions.microsoft.com> wrote in message
news:AD**********************************@microsof t.com...
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

Mar 18 '06 #3

P: n/a
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

"Kevin Spencer" wrote:
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.

"Edward" <Ed****@discussions.microsoft.com> wrote in message
news:AD**********************************@microsof t.com...
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


Mar 19 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.