private void ApplyTextSize(string textSize)
{
// Convert the text to a float because we'll be needing a float shortly
float newSize = Convert.ToSingle(textSize);
FontFamily currentFontFamily;
Font newFont; // Create a new font of the same family but with the new size
currentFontFamily = this.richTextBoxText.SelectionFont.FontFamily;
newFont = new Font(currentFontFamily, newSize);
看msdn上SelectionFont 是个属性,返回的是font ,
font和fontfamily是什么关系
{
// Convert the text to a float because we'll be needing a float shortly
float newSize = Convert.ToSingle(textSize);
FontFamily currentFontFamily;
Font newFont; // Create a new font of the same family but with the new size
currentFontFamily = this.richTextBoxText.SelectionFont.FontFamily;
newFont = new Font(currentFontFamily, newSize);
看msdn上SelectionFont 是个属性,返回的是font ,
font和fontfamily是什么关系
解决方案 »
- C#在一个解决方案中两个项目之间怎么互相调用窗体
- 新手请教:字符串,转换后,如何相加
- 求一段C#代码,希望会的人能帮帮忙
- 如何实现主从报表,已经问过多次了,请求一个最合理的解决方法。
- C#制作播放器,怎么同步显示歌词呢?有谁会的啊
- 在C#中。这个怎么实现
- 求助: 编译后的 exe 文件,版本号问题??
- vs2005 怎么代开服务器上vss里的项目,谢谢
- C#里怎么取一个类或者一个结构的size,就像C++里的sizeof()一样?
- gridcontrol 主从表设置
- 怎么将truedbgrid(Grid) 中录入的数据,直接存在数据库中的一个现有的表中.............?好多软件都是直接存入数据库
- PANEL中的窗体间跳转传参数问题
例如:
下面的示例构造一个字号为 16 像素、常规字形的 Arial 字体。在下面的代码中,传递给 Font 构造函数的第一个参数是 FontFamily 对象。第二个参数指定字体的大小,其单位由第四个参数确定。第三个参数确定字形。Pixel 为 GraphicsUnit 枚举的一个成员,Regular 是 FontStyle 枚举的一个成员。FontFamily fontFamily = new FontFamily("Arial");
Font font = new Font(
fontFamily,
16,
FontStyle.Regular,
GraphicsUnit.Pixel);FontFamily 对象指定字样(例如 Arial),而 Font 对象指定字号、字形和单位。