|
-
May 2nd, 2007, 05:29 PM
#26
Re: The Definitive "Passing Data Between Forms"
Uhhhhh, isn't that exactly what you were saying didn't happen? In your example, changing one instance changed them both, which is what should happen for a reference type.
Kleinma: After reading that, I can sum up my feelings about default instance with one word: Ugh!
Ok, it is what I thought it was, and works the way I thought it worked. I also think that it was added back in as a convenience. When I used that in VB6, I used it without understanding it. That is a convenience, and perhaps it will remain a harmless convenience, but I feel that it will cause confusion for anybody who tries to do anything that gets beyond the default instance. If people become trained to think that Form1 is the name of the form, rather than the name of the class, then they will become confused when they need to make multiple instances of the class.
I haven't used My yet, either.
As far as passing data from Form to Form, it appears that using the default form, you probably can't use an overloaded constructor, as the default constructor must take no arguments. Perhaps that could be altered by removing the default constructor.
What this means is that the default instance has to transfer data using properties, as far as I can see.
My usual boring signature: Nothing
 
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
|