Say I have the following:
I know this is an extremely late answer, but so that people who find this can get a good answer, with protection against for instance Ctrl+C and stuff:
private void textBox1_TextChanged(object sender, EventArgs e)
{
foreach (string line in textBox1.Lines)
{
if (line.Length > 60)
{
textBox1.Undo();
}
}
textBox1.ClearUndo();
}
Note that this does mean you cannot use Ctrl+Z in the textbox anymore but if that doesn't bother you this is a good option, because it works with any font.
EDIT This doesn't work with wpf textboxes, only windows forms textboxes