为什么 C# 中的 fontstyle 枚举缺少粗体斜体?
Possible Duplicate:
c# Make font italic and bold
How do i set the font style of a font to bold italic?
I am unable to set the fontstyle of font to bold italic.. where and how can i set it >?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
FontStyle
是一个Flags
枚举。您可以通过将粗体和斜体组合在一起来发送粗体和斜体:FontStyle.Bold |字体样式.斜体
FontStyle
is aFlags
enumeration. You send bold and italic by or'ing them together:FontStyle.Bold | FontStyle.Italic
尝试
(FontStyle 用 FlagsAttribute 装饰,允许以这种方式组合选项)
Try
(FontStyle is decorated with FlagsAttribute which allows combining options this way)
FontStyle
是一个Flags
枚举:一样使用它
像OR
The
FontStyle
is aFlags
enum:use it like
OR
它是一个位掩码枚举。要组合成员,请使用按位 OR 运算符 (|),如下所示:
另请参阅使用C# 中的位掩码
It is a bitmask enumeration. To combine members use the bit-wise OR operator (|) like this:
See also Using a bitmask in C#
FontStyle 枚举使用 FlagsAttribute 因此,您可以使用按位运算符将多个 FontStyle 作为传递单一参数。
The FontStyle Enumeration uses the FlagsAttribute thus you can use bitwise operators to pass multiple FontStyles as a single parameter.