Sign in to follow this  
unamuna

C# More about classes

Recommended Posts

unamuna    122
Hello again. I have new problem with classes. Its about scope.. I have class, that holds character info, str, dex, int etc. I have few forms, main and shop for example. How can i make object, that is visible EVERYwhere.. class props, money, exp, str,stamina... form1 class object = new class(); object.money = 100; ShopForm shopfrm = new ShopForm(); shopfrm.Show(); form2 object.money -= 10; I cant make it so, that form1 knows about these changes.. This has something to do with "out". I know, that i have to pass the object as reference, so i can edit THE object.. But how do i do that?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this