如何在VB.NET中使用多种字体样式组合?

ssm*_*ssm 7 vb.net fonts

如果我想设置我的字体,我可以使用

new Font=("Times New Roman", 12, Drawing.FontStyle.Bold)
Run Code Online (Sandbox Code Playgroud)

我可以使用Italic,Regular或Underline而不是Bold.

但我想同时使用Bold和Italic.

我怎样才能做到这一点?

Fre*_*örk 12

FontStyle枚举是标志枚举,这样你就可以(使用组合值Or在VB.NET运营商,|在C#):

new Font("Times New Roman", 12, Drawing.FontStyle.Bold Or Drawing.FontStyle.Italic)
Run Code Online (Sandbox Code Playgroud)