Label

Maglor

Member
Joined
Apr 29, 2007
Messages
8
Programming Experience
Beginner
I Have A problem, I want my program to select a label my letting the user type in the number of the layer. But it doesn't work like this:

VB.NET:
        Dim LabelNumber As Integer
        Dim LabelName As String
        LabelNumber = TextBox1.Text
        LabelName = "Label" & LabelNumber
        LabelName.Text = "1"
 
Dim l As Label = Me.Controls("labelname")

If that doesn't work with .Net 1.1 you have to iterate them to see if Name is same (For Each c As Control In Me.Controls, If c.Name = "controlname" Then you found it)
 
Back
Top