Flagsattribute - How to remove a flag from flaglist

Is in this documentation not so easy to find... But it works with the Bitwise XOR Assignment Operator! FontStyle fontStyle = this.textBox1.Font.Style; fontStyle = FontStyle.Italic FontStyle.Bold; fontStyle = fontStyle ^ FontStyle.Bold; //Removes the flag Bold from the fontStyle flagAttributes list http://msdn2.microsoft.com/de-de/library/system.flagsattribute(VS.80).aspx

No comments:

Post a Comment

Latest Posts

Popular Posts