I am trying to set set the font of a TextBox in LightSwitch. I am not sure if there is a problem with my code, or if this just isn't possible.
The code executes, and I have stepped through it to make sure it executes, and all code is reached and executed, but there is not change to the controls on the screen.
My code is:
private void SetMono(string controlName)
{
var ctrl = this.FindControl(controlName);
if (ctrl != null)
{
ctrl.ControlAvailable += (s, e) =>
{
if (e.Control is TextBox) // I put break point here to test. {
var tb = (TextBox)e.Control;
var ff = new System.Windows.Media.FontFamily("courierNew,courier,monospace");
tb.FontFamily = ff;
}
};
}
}
Am I doing something wrong?
(I am using VS 2013)