FontStyle myStyle = FontStyle.Bold | FontStyle.Italic; string styleString = myStyle.ToString(); // Output: "Bold, Italic"
FontStyle myStyle = FontStyle.Bold | FontStyle.Italic; if (myStyle.ToString().Contains("Bold")) { // Do something }These examples are part of the System.Drawing namespace, which is included in the .NET Framework Class Library.