[Newbie]

  • Thread starter =?ISO-8859-15?Q?St=E9phane_Miqueu?=
  • Start date
?

=?ISO-8859-15?Q?St=E9phane_Miqueu?=

Hi,

Just a simple question for witch I can't find an solution.

I've got 4 labels in a form : lbl1, lbl2, lbl3, lbl4.
I want to give them a value in a FOR instruction. Something like :

FOR iCpt = ...
("lbl" & iCpt).text = "My Value"
NEXT

I've searched MSDN, Google, TechNet but I must be dumm !

Thanks.
 
?

=?ISO-8859-15?Q?St=E9phane_Miqueu?=

Stéphane Miqueu avait prétendu :
Hi,

Just a simple question for witch I can't find an solution.

I've got 4 labels in a form : lbl1, lbl2, lbl3, lbl4.
I want to give them a value in a FOR instruction. Something like :

FOR iCpt = ...
("lbl" & iCpt).text = "My Value"
NEXT

I've searched MSDN, Google, TechNet but I must be dumm !

Thanks.

Thanks, I've got the answer :

In the form class :
Dim MyLabels as Label()

In the form load :
Me.MyLabels = New Label(){Me.lbl1, Me.lbl2, Me.lbl3, Me.lbl4}

Somewhere :
For iCpt = 0 To 3
MyLabels(iCpt).Text = "MyValue"
Next
 
M

me

Stéphane Miqueu said:
Hi,

Just a simple question for witch I can't find an solution.

I've got 4 labels in a form : lbl1, lbl2, lbl3, lbl4.
I want to give them a value in a FOR instruction. Something like :

FOR iCpt = ...
("lbl" & iCpt).text = "My Value"
NEXT

I've searched MSDN, Google, TechNet but I must be dumm !

Thanks.
Not very good at this but have you tried an array of textbox...
 
?

=?ISO-8859-15?Q?St=E9phane_Miqueu?=

me avait prétendu :
Not very good at this but have you tried an array of textbox...

Thanks, it's the same thing. Instead of using textbox, I use labels.
 

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