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
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Since your enum and module have not been defined as public then you cannot have a public property expose those privately typed classes.  You need to add Public in front of Module and your enum.

I do not recommend using modules!  This was left for backward compatability.  You should use shared classes.  In the case of your enum, just move it outside of the module and it will reside as its own public enum:

Public Enum MyEnum As Integer
   MyValue = 1
End Enum

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




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

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search