title: How to list Enum's members
body: <p>How to list Enum's members in code? I have the following Enum:</p>
  
  <pre><code>Public Enum TestEnum As int32
      First = 0
      Second = 2
      Third = 4
      Fourth = 6
  End Enum
  </code></pre>
  
  <p>And I try to list all members of TestEnum via the following code but it failed:</p>
  
  <pre><code>Public Class Form1
  
      Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
          Dim Enum1 As TestEnum
  
          Dim Members() As String
  
          Members = System.Enum.GetNames(CType(Enum1, System.Enum))
  
  
      End Sub
  End Class
  </code></pre>
  
  <p>So, my question is: How to list members of an Enum?</p>
  
  <p><strong>Update</strong>: The solution is:</p>
  
  <pre><code>Public Class Form1
  
      Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
          Dim Members() As String
          Members = System.Enum.GetNames(GetType(TestEnum))
  
          MessageBox.Show(Join(Members, Chr(13) &amp; Chr(10)))
  
      End Sub
  End Class
  </code></pre>