Hi,
Place a Panel as panel1,listbox and a button in your form.
in button1_click Event write the code.
private void button1_Click(object sender, EventArgs e)
{
int locx = 0;
int locy = 2;
foreach (var listBoxItem in listBox1.Items)
{
TextBox ctrl = new TextBox();
ctrl.Name = listBoxItem.ToString();
ctrl.Size = new System.Drawing.Size(50, 20);
ctrl.Location = new Point(locx, locy);
ctrl.Text = listBoxItem.ToString();
locx = locx + 50;
panel1.Controls.Add(ctrl);
}
}
In Button Click using loop i read all the listbox item and genearate textbox at runtime and add to Panel Control.
Hope this code will help you.