I've got a TableLayoutPanel (called userPanel) where I create 3 rows containing one label and two text boxes. At the application startup, I create them like this:
Now, is it possible to reference these labels and text boxes created above? Since they don't have names, I haven't found a way to get the contents.
(Specifically, what I want to do is to store the contents in the application.settings, and then load them at the next startup. Which I know how to do.)
C#:
[FONT=courier new]public MainForm() {[/FONT]
[FONT=courier new] InitializeComponent();
[/FONT][FONT=courier new] for (int i = 0; i < userPanel.RowCount; i++) {[/FONT]
[FONT=courier new] userPanel.Controls.Add(new Label() { Text = "Login"});[/FONT]
[FONT=courier new] userPanel.Controls.Add(new TextBox());[/FONT]
[FONT=courier new] userPanel.Controls.Add(new TextBox());[/FONT]
[FONT=courier new] }
}[/FONT]
Now, is it possible to reference these labels and text boxes created above? Since they don't have names, I haven't found a way to get the contents.
(Specifically, what I want to do is to store the contents in the application.settings, and then load them at the next startup. Which I know how to do.)
Last edited: