Hola buenas noches comunidad de foros del web les pido ayuda sobre alguna función condigo etc que me podrían proporcionar
mi problema es el siguiente

creo varios textbox dinámicos en tiempo de ejecución entonces quisiera que al momento de crear uno mediante un botón y otro textbox(aquí ingreso la info y doy clic a otro botón ya creado

) se pasara la info de este al creado dinamicamente
no se si me explique bien

Aquí dejo mi código creando los textbox
Código:
namespace crear_textbox
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
TextBox[] abc = new TextBox[1000];//creamos tamaño de matriz para 1000 cuadritos a crear
int z = 0,y=0;//numero de cuadritos creados y #cuadrito a eliminar
int i = 5, j = 5;//lugar por default
cuadritos cu = new cuadritos();//creamos la clase cu
private void button1_Click(object sender, EventArgs e)
{
//boton 1
j = Convert.ToInt32(textBox1.Text);//posicion X
i = Convert.ToInt32(textBox2.Text);//posicion Y
cu.cuadro(j, i);//llamamos a nuestra clase
abc[z] = cu.cuadrito(); //guardamos nuestro cuadrito
Controls.Add(abc[z]);//lo mostramos al form
z = z + 1;//agregamos un contador de cuadritos
}
private void button2_Click(object sender, EventArgs e)
{
y = Convert.ToInt32(textBox3.Text);
Controls.Remove(abc[y]);//elimina cuadrito
}
class cuadritos {
TextBox tb = new TextBox();
public void cuadro(int x,int y) {
tb = new TextBox();
tb.Size = new System.Drawing.Size(50, 10);
tb.Location = new System.Drawing.Point(x, y);
}
public TextBox cuadrito() {
return tb;
}
}
private void button3_Click(object sender, EventArgs e)
{
//aqui es donde quiero agregar el texto nuevo al nuevo cuadrito creado
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}