[Flags]
public enum myEnum
{
One,
Two,
Three
}
...
// to add flags
myEnum m = myEnum.One | myEnum.Two;
// to remove myEnum.Two (? doesn't work)
m &= ~myEnum.Two;
m ends up being zero after these steps.
Any ideas?
Mike
First, you had better make those "flags" binary. Otherwise you cannot
combine them using binary operators. Well, you can, but what you get is
unusable.
public enum myEnum
{
Flag1 = 1,
Flag2 = 2,
Flag3 = 4,
Flag4 = 8
}
Since the original value of One was 0, and the original value of Two was 1,
then you got exactly what you should get when you do the operations you
outlined. Use the enumeration above and things will work correctly.
"Michael Marshall" <Mpl...@yahoo.com> wrote in message
news:b0c50f08.02111...@posting.google.com...
Mike
"Jason Smith" <jsm...@hotmail.com> wrote in message news:<#yr$Xv4jCHA.2408@tkmsftngp11>...