如何在 C# 中设置 Textbox.Font.Size? [英] How to set Textbox.Font.Size in C#?

查看:34
本文介绍了如何在 C# 中设置 Textbox.Font.Size?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这个格式是字符串的文件中加载 font.size 并且我想通过设置 textbox.font.size这个值,但说这个值是只读的,没有设置"我如何在编码中设置 font.size?

I load font.size in a file that this format is string and i want to set textbox.font.size by this value but say "this value is readonly not set" how i can set font.size in coding?

推荐答案

通过使用它,可以以编程方式选择最佳字体.这还允许您为各种替代字体设置不同的大小.

By Using this it is possible to programmatically choose the best font. This also allows you to set different sizes on the various alternative fonts.

Font font = new Font("Times New Roman", 16.0f, 
                        FontStyle.Bold | FontStyle.Italic | FontStyle.Underline);
textBox1.Font = font;

有关详细信息,请查看 这里

For more details, check here

这篇关于如何在 C# 中设置 Textbox.Font.Size?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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