sharing variables/information between two forms

Background:
Visual c++ .net express 2005
windows xp


I have two forms, inside the same application. Form1 creates Form2, so I assume it is a "child" of some sort. Anyway, I am collecting data via rs232 in the main form (form1) and would like to pass that information to form2. I was looking for some function like "GetParent" to get a handle to the original or any other way that is typical to pass information between forms. I have tried to even compile an old c++ singleton class that I have to share the information, but it doesn't mix well with managed c++ (because of the static variables?) . Anyway, is there a "proper" way to handle this ? I don't really want an MDI type solution. I would like this to all be independent forms so that non pertinent forms can just be minimized or hidden when they aren't needed, as well as the ability to see both forms. Sample code would be most helpful! I'm pretty wet behind the ears on this, as I usually just do embedded C and VHDL.

Thanks!
fenriss_wolffAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Knut HunstadCommented:
Since your form2 is created by form1, then form1 can store a pointer to form2 and call functions or set member variables for form2 directly. Whether form2 is a real "child" of form1 or not is something you define when you create form2. You could also send data to form2 as messages.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fenriss_wolffAuthor Commented:
I'm so new that I didn't even know you forms were inherited, and all I needed to do was create a set function with a pointer to my data that I want to pass from Form1 . Thx!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual C++.NET

From novice to tech pro — start learning today.