Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have created a dynamic control like that
TextBox txnew = new TextBox();
txnew.Location = new Point(34, 34);
this.Controls.Add(txnew);
and want to find out in button click event
Control[] mycon = this.Controls.Find("txnew", true);
but i did'nt find out
plz tell me where i m wrong.
Posted

As someone else said, your basic problem is a complete lack of understanding of what you're doing. More to the point, it's rude of you to ask the same question twice.
 
Share this answer
 
You have missed this:
C#
TextBox txnew = new TextBox();
txnew.Name = "txnew"; // You must set the name in order to find the control later

txnew.Location = new Point(34, 34);
 
Share this answer
 
v2

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