Declaring Enums

T

Terry Holland

I have a an assembly with the following code


Module modEnums
Public Enum enuFixType
ftyButtSide 'jamb full height, header inside jambs
ftyButtTop 'header full width, jambs butt up to header
ftyMorticeSide 'tenons at each end of header
ftyMorticeTop 'tenons at end of jambs
End Enum
End Module

Public Class clsSubFrame

Public Property FixType() As enuFixType
Get
Return m_ftyFixType
End Get
Set(ByVal Value As enuFixType)
m_ftyFixType = Value
End Set
End Property

.......

End Class

This won't build because I get the following error.
C:\_Development\Door Schedule\Door Schedule VB\BO\clsSubFrame.vb(26):
'FixType' cannot expose a Friend type outside of the Public class
'clsSubFrame'.

I want enuFixType availabe to all of my application. Could someone tell me
how/where to declare it to avoid this error.

tia

Terry Holland
 
H

Herfried K. Wagner [MVP]

Terry Holland said:
I have a an assembly with the following code


Module modEnums
Public Enum enuFixType
ftyButtSide 'jamb full height, header inside jambs
ftyButtTop 'header full width, jambs butt up to header
ftyMorticeSide 'tenons at each end of header
ftyMorticeTop 'tenons at end of jambs
End Enum
End Module

Public Class clsSubFrame

Public Property FixType() As enuFixType
Get
Return m_ftyFixType
End Get
Set(ByVal Value As enuFixType)
m_ftyFixType = Value
End Set
End Property

......

End Class

This won't build because I get the following error.
C:\_Development\Door Schedule\Door Schedule VB\BO\clsSubFrame.vb(26):
'FixType' cannot expose a Friend type outside of the Public class
'clsSubFrame'.

The module 'modEnums' is implicitly 'Friend', not 'Public'. Eiter add the
'Public' access modifier or declare the enum outside the module (the latter
is the preferred way).
 
Top