Module Module1
Private Enum TestEnum
one = 1
two
three
four
End Enum
Sub Main()
Dim names As String() = [Enum].GetNames(GetType(TestEnum))
For Each valueName As String In names
Console.WriteLine("{0} = {1}", valueName,
DirectCast([Enum].Parse(GetType(TestEnum), valueName), Integer))
Next
End Sub
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.