private int ORedFlags( object _Sender, CheckBox[] _Choices ) { CheckBox C = _Sender as CheckBox; int Flags = 0; for ( int i=0; i < _Choices.Length; i++ ) if ( _Choices[i].Checked ) Flags |= 1 << i; return Flags; }