Is there a way to combine Enums in VB.net?
The key to combination Enum
s is to make sure that the value is a power of two (1, 2, 4, 8, etc.) so that you can perform bit operations on them (|=
&=
). Those Enum
s can be be tagged with a Flags
attribute. The Anchor
property on Windows Forms controls is an example of such a control. If it's marked as a flag, Visual Studio will let you check values instead of selecting a single one in a drop-down in the properties designer.