C# FontStyle 赋值 或者去掉弄某个值
FontStyle 是枚举类型
而且只有get 是只读的 下边是他的属性
//
// 摘要:
// 指定应用到文本的字形信息。
[Flags]
public enum FontStyle
{
//
// 摘要:
// 普通文本。
Regular = 0,
//
// 摘要:
// 加粗文本。
Bold = 1,
//
// 摘要:
// 倾斜文本。
Italic = 2,
//
// 摘要:
// 带下划线的文本。
Underline = 4,
//
// 摘要:
// 中间有直线通过的文本。
Strikeout = 8
}
赋值直接用“=”是不行的
那就用另一种方式
//添加某一种
FontStyle style = FontStyle.Regular;
style |= FontStyle.Bold;
style |= FontStyle.Italic;
.....
//如果是去掉某一种的话是:
style-=FontStyle.Bold;
.....