With the <Flags>
attribute, the enum becomes a set of flags. This attribute enables assigning multiple values to an enum variable. The members of a flags enum should be initialized with powers of 2 (1, 2, 4, 8...).
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
Dim carMaterials as Material = Material.Plastic Or Material.Metal
Dim knifeMaterials as Material = Material.Metal
Console.WriteLine(houseMaterials.ToString()) 'Prints "Wood, Stone"
Console.WriteLine(CType(carMaterials, Integer)) 'Prints 6
End Sub
End Module