如何在VB.NET中使用多种字体样式的组合? [英] How can I use multiple combinations of font styles in VB.NET?

查看:130
本文介绍了如何在VB.NET中使用多种字体样式的组合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

  new Font =(Times New Roman,12,Drawing .FontStyle.Bold)

而不是粗体,我可以使用斜体,正则或下划线。



但是我想同时使用Bold和Italic。

我该怎么做?

解决方案

> nandferrer> > FontStyle 或者在VB.NET中使用运算符,在c#中使用 |

 新字体(Times New Roman,12,Drawing.FontStyle.Bold或Drawing.FontStyle.Italic)


If I want to set my Font I can use

new Font=("Times New Roman", 12, Drawing.FontStyle.Bold)

Instead of Bold, I can use Italic, Regular or Underline.

But I want to make use of Bold and Italic at the same time.

How can I do this?

解决方案

The FontStyle enumeration is a flags enumeration, so you can combine values (using the Or operator in VB.NET, | in c#):

new Font("Times New Roman", 12, Drawing.FontStyle.Bold Or Drawing.FontStyle.Italic)

这篇关于如何在VB.NET中使用多种字体样式的组合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆