TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ankit Agarwal
NA
379
254.3k
How to store folderbrowserdialog value in textbox at runtime
Dec 23 2016 1:20 AM
Hello,
I want to create application for runtime for create controls and functionality, controls created successfully but value not storing in text box according folder dialog.
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);
}
Please help me.
How can be resolve that?
Thanks
Ankit Agarwal
Software Engineer
Reply
Answers (
1
)
The instruction at "0xXXXXXXXX" referenced memory at "0xXXXX
DOWNLOADING DATA IN DATAGRIDVEW ALONG WITH IMAGES IN EXCEL