Enum Properties Revisited

Z

zacks

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?
 
M

Mattias Sjögren

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
 
Z

zacks

Actually it started to work simply by letting intellisense pick the
property name instead of me keying it in.
 
G

Guest

Even though you've added it as a reference, you might need to add an imports
statement for the class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top