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
CherRon McLemore
NA
32
0
passing data from child form to parent form C#
Jul 28 2010 2:34 PM
Hello. I am working on a GUI that has two forms (Form1 & child). I have two global variables on the forms to use to pass data between them. When a button is clicked on Form1, child pops up and data is passed to its global variable. When a button is clicked on child, I want to pass some data back to Form1. How do I do that?
Ex.
Form1:
Form2 child = new Form2();
public string imagePath;
private void btn_Click(object sneder, EventArgs e)
{
child.path = imagePath;
}
child:
public string path;
private void btn_Click(object sneder, EventArgs e)
{
(Form1 global variable) = path;
}
How do I correct the method in the child form?
Reply
Answers (
2
)
Updating dataGridview when save button is clicked
Maths knowledge