|
-
May 10th, 2011, 01:17 AM
#2
Re: Access properties in a different class
It "doesn't work" because you are trying to access it as if it were a static field. It is not; it is a member variable, i.e., a separate instance of that string belongs to each separate instance of your Form1 class. You will (and should) pass it as an argument to avoid passing references to your main form around all over the place.
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
|