Using Tag property of a textBox in C#
Posted on 2015-02-16
I am trying to use the Tag property of a TextBox in a Windows form to store the data in the text property of that TextBox.
I understand that the Tag property is an Object that needs an instance created object before using it.
So I tried the following code:
control myNewControl = new control();
myNewControl .Tag = TextBox.Text;
string str = myNewControl. Tag.ToString();
The above code produces an error. Can you please show me how to use the Tag correctly to implement the above?