从后面的代码设置文本框的字体 [英] Setting Font of TextBox from code behind

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

问题描述

这可能是愚蠢的问题,但我怎么设置的文本框字符串字体代码背后?

  //例如
txtEditor.FontFamily =索拉


解决方案

  txtEditor。的FontFamily =新的FontFamily(索拉); //媒体命名空间


This maybe a stupid question but 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

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

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