I want to change the font type of a multiple line enabled textbox control of a lightswitch application. There is a previous question on how to do this. However, I'm not certain WHERE to place that code.
The reference question that was previously answered is:
However, I'm just not a c# programmer and am sloppily hacking my way through this. I've currently placed the code I copied here in a file called ClinicMessagesListDetail.lsml.cs: (however, it doesn't seem to help or hurt the program)
using System;
using System.Linq;
using System.IO;
using System.IO.IsolatedStorage;
using System.Collections.Generic;
using Microsoft.LightSwitch;
using Microsoft.LightSwitch.Framework.Client;
using Microsoft.LightSwitch.Presentation;
using Microsoft.LightSwitch.Presentation.Extensions;
using System.Windows.Controls;
namespace LightSwitchApplication
{
public partial class ClinicMessagesListDetail
{
private void SetMono(string Message)
{
var ctrl = this.FindControl(Message);
if (ctrl != null)
{
ctrl.ControlAvailable += (s, e) =>
{
if (e.Control is TextBox)
{
var tb = (TextBox)e.Control;
tb.FontFamily = new System.Windows.Media.FontFamily("Consolas");
}
};
}
}
}
}
This is the first time I've posted here and hope that I'm following all the guidelines.
Thank you Dave S