An Enum question


Author
Message
StarkMike
StarkMike
Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)
Group: Forum Members
Posts: 436, Visits: 944
Here is the error i'm getting:

'ParentFormID' cannot expose type 'Module1.ParentFormIDEnum' outside the project through class 'MyClass'.

Here is the related code:

Module Module1

    Enum ParentFormIDEnum As Integer
        POReceiving = 1
        Production = 4
        Returns = 5
    End Enum

End Module

Public Class MyClass

    Public WriteOnly Property ParentFormID() As ParentFormIDEnum
        Set(ByVal value As ParentFormIDEnum)
         miParentFormID = value
        End Set
    End Property

End Class

I'm not sure what this error means. All I'm trying to do is create a global enum and be able to use it in all areas of my program.

Reply
Paul Chase
Paul Chase
Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Lol didnt see Trent already answered you. I agree about modules.

1)  If you reference your project from another project, whether VB or C#, the module routines aren't accessible even if they're public.

2)  You can name a local method in a class the same as a public module routine, and the compiler won't say anything about it.  When you use the method, the compiler won't require you to prefix it; it'll just happily use the local version instead of the module with no warning.

Shared classes, on the other hand, are accessible to outside projects (if you want them to be), and shared classes avoid the ambiguity because of the prefixed class name.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
StarkMike - 19 Years Ago
Trent L. Taylor - 19 Years Ago
Paul Chase - 19 Years Ago
Paul Chase - 19 Years Ago
StarkMike - 19 Years Ago
StarkMike - 19 Years Ago
StrataFrame Team - 19 Years Ago
Ivan George Borges - 18 Years Ago
Trent L. Taylor - 18 Years Ago
                         No, Ivan, you can have as many Imports as you want... they don't...
StrataFrame Team - 18 Years Ago
                             Thanks guys, got the idea.
Ivan George Borges - 18 Years Ago
                                 Anything for you, Ivan :D
Trent L. Taylor - 18 Years Ago
StarkMike - 19 Years Ago
StarkMike - 19 Years Ago
StrataFrame Team - 19 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search