VB 2010 - A variable with a value of a label name

前端 未结 5 1442
北荒
北荒 2021-01-22 13:18

I\'m using VB 2010 Express and have a label named \"lblTitle\" in my form. The next code doesn\'t work and I know it , but how can I do something like this?

Dim          


        
5条回答
  •  礼貌的吻别
    2021-01-22 13:46

    After a deep google search , the answer seems to be easy as that:

       Dim bla = "lblName"
       Me.Controls(bla).Text = "Dan"
    

    while lblName is the label's name in the form. Thanks guys

提交回复
热议问题