The HasFlag()
method can be used to check if a flag is set.
Module Module1
<Flags>
Enum Material
Wood = 1
Plastic = 2
Metal = 4
Stone = 8
End Enum
Sub Main()
Dim houseMaterials As Material = Material.Wood Or Material.Stone
If houseMaterials.HasFlag(Material.Stone) Then
Console.WriteLine("the house is made of stone")
Else
Console.WriteLine("the house is not made of stone")
End If
End Sub
End Module
For more information about the Flags-attribute and how it should be used see the official Microsoft documentation.