|
-
Apr 24th, 2007, 06:42 AM
#7
Thread Starter
Addicted Member
Re: Form class variables and static functions
 Originally Posted by Wokawidget
In answer to your question about referencing a form thats not active, you would need to use the following code:
Code:
foreach (Form1 myForm in Application.OpenForms)
{
//basing it on only having 1 form1 open
int myVar = myForm.Varible1;
}
If your form is using variables that are used globally then maybe you should think about storing them in a shared class...
Woka
Would you mind a quick explantion of a shared class? I'm not familiar with classes, I'm just beginning to understand them, so I don't really know the difference between partial, shared, etc, and how/when/why to use each.
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
|