|
-
April 11th, 2001, 03:11 PM
#1
passing Reference of an instance of a class
I have built a class and instantiated it on my Main Form. I want every other Form to use this same instance of the class. How can I pass the instance reference to other forms.
thanks in advance,
bcoyote
-
April 11th, 2001, 03:40 PM
#2
Re: passing Reference of an instance of a class
There are a couple of choices here:
One is to add a standard module to the project and declare the variable as public, but initialize it in your main form. You'd be able to access it in all forms of the project.
Another would be to add it as a public variable of the main form and let the other forms access it throught the main form (e.g. frmMain.myClassInstance).
I'm sure these aren't the only alternatives, but they will work.
thanx/good luck,
adam
thanx/good luck
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|