从后面的代码设置TextBox的字体 [英] Setting up font of TextBox from code behind

查看:73
本文介绍了从后面的代码设置TextBox的字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在后面的代码中从字符串设置 TextBox 的字体?

How do I set the font of a TextBox from a string in the code behind?

// example
txtEditor.FontFamily = "Consolas";


推荐答案

txtEditor.FontFamily = new FontFamily("Consolas"); // the Media namespace

这篇关于从后面的代码设置TextBox的字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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