enum question

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

If I've identified a type as enum, is there a way to accees its contents (names,
etc) without instantiation?

Bob
 
Bob said:
If I've identified a type as enum, is there a way to accees its contents (names,
etc) without instantiation?

\\\
Dim s As String
For Each s In [Enum].GetNames(GetType(KnownColor))
Me.ListBox1.Items.Add(s)
Next s
///

Replace 'KnownColor' with the name of your enum.
 
Never mind, I got it.

Duh...GetNames is static. I just had to bracket it.

[Enum].GetNames(t)

Bob
 
Back
Top