Indexed controls under VB 2005, how to do ?

D

degas

Hello all !

I'm trying "upgrading myself" (I'm afraid it won't be easy...) from VB 5.0
to VB 2005 Express Edition.

In VB 5, I was used to creating indexed controls at design time, let's say
lbl(0), lbl(1), and so on...
It was quite easy : creating lbl, setting the Index property (0), then
Ctrl-C on lbl(0), and Ctrl-V as often as necessary.

In VB 2005 Express, I'm unable to find the Index property of a label.

In order to understand, I have designed -- under VB 5 -- a very simple
project with 2 indexed labels and I have loaded it under VB 2005. It runs
but, according to the Property window, these controls are named "_lbl_0" and
"_lbl_1" instead of the expected lbl(0) and lbl(1).
In the source code , I can read "lbl(i)", as I have written under VB5.

Having a look at the code, I'm unable to understand how it works. It appears
to me much more difficult than VB5.

Do I have to build my form ONLY with some code and to create my controls at
run time ?
Is it possible to declare an array of labels ? How ?

Thanks a lot for your help.

Gabriel
 
T

Tom Shelton

Hello all !

I'm trying "upgrading myself" (I'm afraid it won't be easy...) from VB 5.0
to VB 2005 Express Edition.

In VB 5, I was used to creating indexed controls at design time, let's say
lbl(0), lbl(1), and so on...
It was quite easy : creating lbl, setting the Index property (0), then
Ctrl-C on lbl(0), and Ctrl-V as often as necessary.

In VB 2005 Express, I'm unable to find the Index property of a label.

In order to understand, I have designed -- under VB 5 -- a very simple
project with 2 indexed labels and I have loaded it under VB 2005. It runs
but, according to the Property window, these controls are named "_lbl_0" and
"_lbl_1" instead of the expected lbl(0) and lbl(1).
In the source code , I can read "lbl(i)", as I have written under VB5.

Having a look at the code, I'm unable to understand how it works. It appears
to me much more difficult than VB5.

Do I have to build my form ONLY with some code and to create my controls at
run time ?
Is it possible to declare an array of labels ? How ?

Thanks a lot for your help.

Gabriel

First the bad news... There is no such thing as a control array in
VB.NET. Sure, you can create arrays and lists of controls, but you
have to do it your self, the ide won't do it for you.

Now, there may or may not be good news here depending on what you want
to do with the array? Why don't you give an example of what it is you
wish to accomplish, and someone can probably point you to a solution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top