private void btnBrowse_Click(object sender, EventArgs e)
{
//LoadControls();
ChooseFolder();
}
public void ChooseFolder()
{
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
TextBox textbox = new TextBox();
textbox.Text = folderBrowserDialog1.SelectedPath;
MessageBox.Show(textbox.Text);
}
}
private void btnAdd_Click(object sender, EventArgs e)
{
int count = panel1.Controls.OfType<Label>().ToList().Count;
TextBox textbox = new TextBox();
count = panel1.Controls.OfType<TextBox>().ToList().Count;
textbox.Location = new Point(3, 25 * count);
textbox.Size = new Size(188, 20);
textbox.Name = "textbox_" + (count + 1);
textbox.TextChanged += new System.EventHandler(this.TextBox_Changed);
panel1.Controls.Add(textbox);
Button button = new Button();
//count = panel1.Controls.OfType<Button>().ToList().Count;
button.Location = new Point(207, 25 * count);
button.Size = new Size(75, 23);
button.Name = "button_" + (count + 1);
button.Text = "Browse " + (count + 1);
button.Click += new System.EventHandler(this.btnBrowse_Click);
panel1.Controls.Add(button);
}