Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello! I create dynamically TextBoxes such:

C#
private void CreateLabels(int lblID, string lblName) {

           y_lbl = y_lbl + 38;
           Label lbl = new Label();
           lbl.Name = "lbl_" + lblID;
           lbl.Text = lblName;
           lbl.AutoSize = true;
           lbl.Location = new Point(63, y_lbl);
           lbl.Size = new Size(33, 13);
           CrtCurs.Controls.Add(lbl);

       }


After i wanna get value of TextBox with Name = lbl_1;
How i can do it?
Posted

1 solution

This should do it

http://stackoverflow.com/questions/9066118/c-sharp-get-value-of-dynamically-created-control
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900