473,326 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

problems : property with public enum type

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
2 3205
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kevin Auch | last post by:
Hi, I try to declare a property which is an enum type, but i doesn't works, I get the following message : "Inconsistent accessibility: property type 'eType' is less accessible than property...
0
by: davesauny | last post by:
Hi guys, I'm having trouble with serialization especially of array elements! What I have is an array of clsUsers which have various properties as shown in the code below The XML I want to...
6
by: Bob | last post by:
It should be simple, but I'm stuck on this one... how do you return a value for an enum property type? TIA, Bob
0
by: Brian Young | last post by:
Hi all. I'm using the Property Grid control in a control to manage a windows service we have developed here. The windows service runs a set of other jobs that need to be managed. The control...
62
by: djake | last post by:
Someone can explain me why to use property get and property set to access a value in a class, insted of access the value directly? What's the usefulness of property statements in VB.NET? Thanks
0
by: student | last post by:
In Summary: Create an object - dont set one of its Enum Type properties and make sure it does not appear in XML Object Serialization. Strings function as hoped for but Enums do not Heres my...
4
by: Pritcham | last post by:
Hi all I've got a number of classes already developed (basic entity classes) like the following: Public Class Contact Private _firstname as String Private _age as Integer Public Property...
3
by: Tom C | last post by:
I need to expose a property as a list in the designer properties. Somthing like Friend Property MyControlChoice as system.string get return me._myControlChoice end get set value as...
6
by: Rick | last post by:
Hi group, I'm trying to inherit from the windows checkbox control. This is no problem. My goal is to add a property that is based on an enum. When I have an enum declared within the class, it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.