Click here to Skip to main content
15,920,383 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have seen lot of articles on how to pass value(s) from child form to parent form.

But I would like to know, how to pass value from Parent form to Child form.

I have done this by declaring static variable in static class in PARENT page and accessing same variable in child class, but I don't think its an appropriate way. Because this same variable will be accessible for other forms of the application and may create a confusion in the application.

Could somebody suggest exact and clean way to pass variable from parent to child.
Posted
Updated 9-Apr-13 4:39am
v2
Comments
[no name] 9-Apr-13 10:13am    
Why do you not pass the data through the child form constructor?

 
Share this answer
 
Use State management technique. if you want this values between two pages then use hidden field or query string. for multiple pages use session
 
Share this answer
 
Comments
sam7one 9-Apr-13 10:36am    
But I would like to achieve this in Windows application, is it possible to use hidden field or query string in windows c#

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900