While new to OOP/VB.NET but not to programming, I am clearly one concept short of an understanding.
I want to write a simple generalised routine that will perform some basic actions on controls (textboxes, labels, etc.) where the name of the control will be passed as an argument.
I am clearly misunderstanding the use of classes & objects and would like to get a simple bit of code like this to work;
- create a new instance from the Label class
- Trying to set up an indirect reference to a label (e.g. "Label5"
- change the background colour of Label5
Obviously this does not set up the indirect reference I am looking for but how can I??
Thanks in advance
I want to write a simple generalised routine that will perform some basic actions on controls (textboxes, labels, etc.) where the name of the control will be passed as an argument.
I am clearly misunderstanding the use of classes & objects and would like to get a simple bit of code like this to work;
VB.NET:
Dim objLabel As New Label
VB.NET:
objLabel.name as "Label5"
VB.NET:
objLabel.BackColor = color.black
Obviously this does not set up the indirect reference I am looking for but how can I??
Thanks in advance