English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Here is what i ment:

I have 19 lable components and 19 textfiles. I want to read the text from each textfile into the corresponding label. In other words

Text in textfile1.txt in label1
Text in textfile2.txt in label2
Text in textfile3.txt in label3
Text in textfile4.txt in label4
and so on... until 19

Can I put a counter and a loop, increase the counter by 1 and the label name by 1?
In other words, can I do this?

Dim I As Integer = 1
Do Until I = 20
(Label + I).text = my.......ReadAllText(path + "textfile" + I.toString + ".txt")
Loop

I know it is possible for the textfile and I've tried it. But is it possible for the label name? And how can I do it?

2006-10-23 00:58:19 · 1 answers · asked by Anonymous in Computers & Internet Programming & Design

1 answers

lbl = Me.Controls("Label" + I.ToString())

lbl.Text = "your text here"

2006-10-23 01:20:54 · answer #1 · answered by IT Pro 6 · 0 0

fedest.com, questions and answers