Call IsDefined with a variable of type PetType.
<Flags> Public Enum PetType As Integer
None = 0
Dog = 1
Cat = 2
Rodent = 4
Bird = 8
Reptile = 16
Other = 32
End Enum
Module Example
Public Sub Main()
Dim value As Object
value = PetType.Dog
Console.WriteLine("{0}: {1}", value, [Enum].IsDefined(GetType(PetType), value))
value = PetType.Dog Or PetType.Cat
Console.WriteLine("{0}: {1}", value, [Enum].IsDefined(GetType(PetType), value))
End Sub
End Module
Related examples in the same category