Kelly Dyjur

Kelly Dyjur

  • NA
  • 3
  • 0

Access Label through variables

Apr 16 2006 9:15 AM

I am new to VB.net and am doing some coding on a simple game to teach myself some of the basic elements of the language. I am stuck on one small thing right now, and have searched for a solution, with no luck. Here is my problem:

I want to be able to change the text property of a label using variables. For example, the label text that I want to access is:

lblIndustrials130.text

But I want to be able to access it using variables within the program:

"lbl" & strCommodity & intCommodityWorth & ".text"

I want to access a certain label based on certain variables. I hope this is clear enough, can someone help a new person?


Answers (2)