Enum Properties Revisited

  • Thread starter Thread starter zacks
  • Start date Start date
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?
 
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
 
Actually it started to work simply by letting intellisense pick the
property name instead of me keying it in.
 
Even though you've added it as a reference, you might need to add an imports
statement for the class
 
Back
Top