Home All Groups Group Topic Archive Search About
Author
17 Nov 2006 9:13 AM
Stéphane_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.

--
Ami Calmant
Stéphane

Author
17 Nov 2006 10:59 AM
Stéphane_Miqueu
Stéphane Miqueu avait prétendu :
Show quoteHide quote
> 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

--
Ami Calmant
Stéphane
Author
17 Nov 2006 2:25 PM
me
Stéphane Miqueu wrote:
Show quoteHide quote
> 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...


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Author
17 Nov 2006 2:59 PM
Stéphane_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.

--
Ami Calmant
Stéphane