0

How can I save dynamically added textboxes in the project in runtime?

I add textboxes like that and I want to save them into my project.

int x = 10;
        int y = 20;
        for (int i = 1; i <= 5; i++)
        {
            TextBox a = new TextBox();
            a.Location = new Point(x, y);
            y += 30;
            a.Name = "1";
            a.Text = "2";
            this.Controls.Add(a);
        }
Jens Erat
  • 37,523
  • 16
  • 80
  • 96

1 Answers1

0

I don't know that you can save them in your 'project' per-se, but you could serialize the dynamic information to any type of data-storage (XML, database, etc.) and initialize your application with that information each time it starts. Sorry if that doesn't answer your question.

maelstrom
  • 1,111
  • 8
  • 7