473,387 Members | 1,573 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,387 software developers and data experts.

Enum Properties Revisited

I have a class library that contains:

Public Class clsClassLibrary

Public Enum myMethods
METHOD1
METHOD2
End Enum

Private _method As myMethods

Public Property Method as myMethods
Get
Return _method
End Get
Set(ByVal value as myMethods)
_mymethod = value
End Set
End Property

End Class

This class library's DLL is added as a Reference to my main project.

In the main project I try to:

Dim myClassLibrary as New clsClassLibrary

myClassLibrary.Method = myMethods.METHOD1

But VS2005 tells me that myMethods is not declared. How come?

Feb 28 '06 #1
3 833
>myClassLibrary.Method = myMethods.METHOD1

But VS2005 tells me that myMethods is not declared. How come?

Because it's nested inside the class. Try
clsClassLibrary.myMethods.METHOD1.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Feb 28 '06 #2
Actually it started to work simply by letting intellisense pick the
property name instead of me keying it in.

Feb 28 '06 #3
Even though you've added it as a reference, you might need to add an imports
statement for the class
--
Dennis in Houston
"za***@construction-imaging.com" wrote:
Actually it started to work simply by letting intellisense pick the
property name instead of me keying it in.

Mar 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: thechaosengine | last post by:
Hi all, I have a problem that I havent really come accross before. I need to be able to allow the user to set a dropdown control to a particular colour value. The permissable values come from...
3
by: Hans De Schrijver | last post by:
Im puzzled by a data validation behavior I don't understand, related to enums. Stripped down scenario: enum Type {One=1, Two=2, Three=3} Type var1 = (Type)40; These two lines of code don't...
6
by: Michael Isaacs | last post by:
Regarding use of enum's, I am wondering what the cost of memory is when creating the enumeration on the calling side, and then using it on the function/method side. See example below. If I...
2
by: roel.schreurs | last post by:
When I make an enumeration, the various values are accessed by <enum_name>.<option1>. I noticed that each option has properties that return any of the options in the enumeration, as can easily seen...
4
by: | last post by:
Hi all, I currently have a custom vb object which has several Enum properties. Now, on the end-user web form I am manually displaying a drop-down list with the options for each of these properties....
10
by: Michael Feld | last post by:
Hello, does anyone know how to produce a data type which offers Enum-like IntelliSense in VS 2005? What I am trying to create is a type which is very similar to an enum, i.e. has a fixed set of...
4
by: veerleverbr | last post by:
Suppose having define an enum like this: public enum SomeEnum { Something, SomethingElse }
7
by: Harris | last post by:
Dear all, I have the following codes: ====== public enum Enum_Value { Value0 = 0, Value1 = 10,
34
by: Steven Nagy | last post by:
So I was needing some extra power from my enums and implemented the typesafe enum pattern. And it got me to thinking... why should I EVER use standard enums? There's now a nice little code...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

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.