How do I shorten Someclass.Class.SOMEFLAG to just SOMEFLAG

M

Mike

Hi,

If I declare an enumeration such as

Public Enum EnumSomeFlags
Flag1 = &H1
Flag2 = &H2
End Enum

Public ReadOnly Property DevStatusFlags() As EnumLineSomeFlags
Get
'Do Stuff
LineDevStatusFlags = m_DevStatusFlags()
End Get
End Property

When I use the property I get the whole enumvalue. Ie

DevStatus = SomeClass.Class1.Flag1

When all I want to see is

DevStatus = Flag1

Any way to do this.

Thanks,
 
C

Chris Dunaway

When I use the property I get the whole enumvalue. Ie
DevStatus = SomeClass.Class1.Flag1

When all I want to see is
DevStatus = Flag1

At the top of your source, use an imports statement:

import SomeClass.Class1.EnumSomeFlags


Then you should be able to just refer to Flag1 (as long as there are no
naming conflicts with something else)

Chris
 

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