Setting up font of TextBox from code behind

Jiew Meng picture Jiew Meng · Oct 23, 2010 · Viewed 88.6k times · Source

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

// example
txtEditor.FontFamily = "Consolas";

Answer

Gishu picture Gishu · Oct 23, 2010
txtEditor.FontFamily = new FontFamily("Consolas"); // the Media namespace