By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,678 Members | 1,175 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,678 IT Pros & Developers. It's quick & easy.

problems : property with public enum type

P: n/a
Hello,

I have have module where I have created a public enumtype that I want to
reuse in different classes .

As soon as I create a public property with this type . Vb warns me that the
'Friend' type can not be used as a public type .

Option Strict is on , so it's possible that this problem only occurs in this
case .

Is there a way to resolve this problem ?

Hoping to hear from you ...

Filip W.
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Filip,
I have have module where I have created a public enumtype that I want to
reuse in different classes . You have two options:

1. The Module itself defaults to Friend, change it to Public.

Option Strict On

Public Module MyModule
Public Enum MyEnum
MyValue
End Enum
End Module

2. Do not put the Enum in the Module, Enum is a Type it does not need to be
in a Module, Class, or Structure (it can be, but it doesn't have to be).

Option Strict On

Public Enum MyEnum
MyValue
End Enum

Module MyModule
End Module

Hope this helps
Jay

"Filip Wtterwulghe" <fi******@c3.be> wrote in message
news:3f***********************@reader0.news.skynet .be... Hello,

I have have module where I have created a public enumtype that I want to
reuse in different classes .

As soon as I create a public property with this type . Vb warns me that the 'Friend' type can not be used as a public type .

Option Strict is on , so it's possible that this problem only occurs in this case .

Is there a way to resolve this problem ?

Hoping to hear from you ...

Filip W.

Nov 20 '05 #2

P: n/a
Hi Filip,

In other words a Module is not a file.

Just as you can have two or more Classes in a file, so you can have
several Modules, Enums and all the other top-level items.

Regards,
Fergus
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.