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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving classes around window froms.

Status
Not open for further replies.

Norviking

Programmer
Nov 2, 2002
33
NO


I have just sent a class object1 from one window form to a function in another form. In this window form, I have a button that will again open another window form, and I want to send my class object1 to this form.

How may this be possible?

When I make a new class object, is it possible to make it "Public" for all the forms I will use?
 
if you've passed it across to a function in the 2nd winform then make a local instance in that form of the class. Work on it as you need to and pass this instance to your 3rd winform the same as you did with the original instance.

If you've made the original instance in the first winform public then any winform with the correct accessibility to the original (namespace, using directives, references etc) will be able to see it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top