Need Help: Shifting text in labels

abo0badr

Member
Joined
Nov 22, 2012
Messages
9
Programming Experience
3-5
I was doing this using VB6 the old days. But I really can't find a way for it using VB.NET.
The idea is to shift a text or caption of a label into the next label.

just like in this simple example:

Label Name >>>>>> Caption/Text

LBOut1 >>>>>> (NULL/No caption)
LBOut2 >>>>>> (NULL/No caption)
LBOut3 >>>>>> My name

after a second or specific time (using a timer)

LBOut1 >>>>>> (NULL/No caption)
LBOut2 >>>>>> My name
LBOut3 >>>>>> is

after a second or specific time (using a timer)

LBOut1 >>>>>> My name
LBOut2 >>>>>> is
LBOut3 >>>>>> Ali

I used to do it using vb6 by creating a label then just copying and pasting two times to create another labels with an array.
and using this code to display them by shifting:

For shift = 2 To 0 Step -1 'Shift previous hex strings up on the display
LBOUT(shift + 1).Caption = lbOUT(shift).Caption


Next shift

I really can't find a way using vb.net. I had this problem for 5days now, and I'm disappointed in my skill :(
Any help from you guys is much appreciated. Thanks
 
You can look up the control in the Controls collection it belongs to by index or name. For example Me.Controls(index) or Me.Controls("Label" & index.ToString) if you have named them numerically.

You can also reference the controls in question using an array and index that, for example
Dim labels = {Label1, Label2, Label3}

Then index the labels array as usual.
 
Back
Top