Windows Develop Bookmark and Share   
 index > Windows Forms General > Passing information between two mdi child forms
 

Passing information between two mdi child forms

Hey,
I have a mdi parent form as form1 and two child forms as frmA and frmB. frmA has one textbox& one button andfrmB has one listbox with several values. When i click on open menu on form1, then a new instance of frmA is created and shown as fA. Now when i click on the button on fA, it creates the new instance of frmB as fB with form1 as mdiParent. What i want to achieve is when i double click any value in the listbox of fB then the selected value should appear in the textbox of fA. The problem i am facing is that i dont know how to refer fA from fB as both are the instances of their respective forms.

Please help with a small code if possible. Thanks in advance.

gaurav2  Monday, April 16, 2007 9:09 AM
Change the constructor for frmB and let it take an argument of type frmA. Store the passed reference in a class field for later use. When frmA creates an instance of frmB, it should pass "this".
nobugz  Monday, April 16, 2007 11:45 AM
Change the constructor for frmB and let it take an argument of type frmA. Store the passed reference in a class field for later use. When frmA creates an instance of frmB, it should pass "this".
nobugz  Monday, April 16, 2007 11:45 AM
hey,
I just came to know that 'NOBUGZ was here'. he he.
Thanks for the support.
gaurav2  Tuesday, April 17, 2007 6:13 AM

You can use google to search for other answers

Custom Search

More Threads

• combo acting weird after convert to vs05
• What's the easiest way to display an array of data on a form?
• Getting the right Output from a function....
• Making a control anisotropic?(EDIT-28.08-finally fixed)
• What do i do once i have built my application?
• Request a remote service when a FileDrop formated object is dropped
• C# GUI Tables
• chart component (for data plot) in windows form applications! (chartspace)
• How to display Unicode data stored in MSSQL as shift-jis in ASP
• MDI in Whidbey