Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass Object Reference Between Forms

Status
Not open for further replies.

Jwithrow

Programmer
Jul 20, 2002
2
US

I have an object class that is populated with data on one form, how can I pass this to another form?

Thanks in advance.
 
You do this by making the object public. This can be done by declaring the object as public, or better, using a property to control access to it.

Do a search here, and on the VB.NET forum for the words "form" and "public".

Chip H.
 
Thanks,
It was public.

The problem I was having was solved by creating an instance of the object on Form1, then in form2 setting Form1.ObjectA = form2.ObjectA

But if I didn't initialize the object in Form1 1st, it would throw-up.


It was my bad, thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top