|
-
Sep 25th, 2007, 07:42 AM
#4
Re: [2005] How do you pass a structure to another form
 Originally Posted by penguin5000
Thanks for your reply. I've made the following changes, and the error has moved to somewhere else.
- I've created a module, and I've put the Products structure in it, and I've removed it from everywhere else.
- I've put the strProducts declaration in the module as public, too.
The error is now here:
Code:
Public Class DisplayResultsWindow
Public WriteOnly Property ProductsOutOfBalance() As List(Of Products)
Set(ByVal value As List(Of Products))
....
End Set
End Property
and reports:
Again, you shouldn't be declaring the structure inside any other type, including a module. Declare it in its own code file. It's a type, just like a class or a module. Treat it like any other type and declare it in its own code file. Don't nest it inside any other type unless you have a specific reason for doing so.
As to your issue, I'm guessing that your module is declared Friend, so any types declared inside it are also Friend. You can't then expose a Friend type via a Public variable. If a type cannot be seen from outside the assembly then how can an instance of the type?
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
|