Link to home
Start Free TrialLog in
Avatar of BlakeMcKenna
BlakeMcKennaFlag for United States of America

asked on

Reference a Class Object?

I have often not used classes because I was never sure how to reference them correctly. My scenario is that I have a bunch of forms in my project. In the same project is a "GeneralClass" file that contains many different classes (primarily used to represent Database Tables).

Lets say I instantiate a particular class in form1. I load the various properties (which again represent columns of Data Tables) with data. Then...in form2, I need to be able to take the data from that class and move that data into different controls on form2. What is the best way to do this?

I actually created a new project that contained that "GeneralClass" file. I got to thinking that if I'm not going to use that project in any other solution, I might as well just create that "GeneralClass" file within this project. How far off am I?

Thanks!
SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BlakeMcKenna

ASKER

CodeCruiser,

I know what your saying about resuability. I do try to do that but often catch myself just incorporating "Modules" within the project. It's a lazy thing!

James,

I've never quite understood constructors and was unaware that I needed to pass a class object thru a constructor. I'll play around with this. Know of any good references that clearly explains how to use Constructors?

Thanks guys!
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks guys!