Hi, I am creating a program for my business that allows us to write quotes quickly, I am fairly new to C# and am stuck on a particular matter.
i cannot relate to my Dynamically created textbox no matter what i name it, i am using the following code to create the textbox.
TextBox field2 = new TextBox();
field2.Location = new Point(15, 85);
field2.Size = new Size(185, 20);
field2.Name = "textBox2";
field2.Visible = true;
this.Controls.Add(field2);
Whenever i relate to field2 i get the error that field2 does not exist despite being created when i click the button in debug mode.
I merly want to relate to it in a button so i can store the text in a variable and need help please.