ravi asrani
Hello all, I am working with the reflection and i am trying to find out a solution which can lead to some easier method. I just wanted to ask that is it possible to create an instance of an object with its name as the value of anyother variable. If Yes then please tell me about that.
I have tried for setting the name property afterwards but that is not enough for the requirement.
I have tried as follows :
System.Windows.Forms.TextBox t = new TextBox();
string s = "txtName";
t.Name = s;
but that will not refer to the original object t.
it will just show the name property as the value of the variable s.
but i want to create the object at the time of the its instance.
like
System.Windows.Forms.TextBox (Here i want the value of the variable) = new TextBox();
Please reply if u know the answer.