列挙体の項目数を取得する
C#の場合はGetType()の代わりにtypeof()を使う。
Public Class Form1
Private Enum Users
Id
Name
End Enum
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MessageBox.Show([Enum].GetNames(GetType(Users)).Length.ToString)
End Sub
End Class