Show current line number in multiline textbox (C#)

I use the KeyUp and MouseUp events to trigger a quick lookup to show the current line number where the insertion point is in a multiline textbox.  In the following example, my multiline textbox is called txt_FileContents and I wrote a single method (UpdateCurrentLineNumber) that fetches the current line number, the total number of lines in the textbox, and then updates a label (lbl_LineNumber) to show the information.  Happy coding!

[csharp]

void txt_FileContents_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
UpdateCurrentLineNumber();
}

void txt_FileContents_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
UpdateCurrentLineNumber();
}

private void UpdateCurrentLineNumber()
{
int index = this.txt_FileContents.SelectionStart;
int line = this.txt_FileContents.GetLineFromCharIndex(index) + 1;

lbl_LineNumber.Text = ” Ln ” + line.ToString(“N0″) + ” / ” + this.txt_FileContents.Lines.Count().ToString(“N0”);
}

[/csharp]

Increase/Decrease Textbox Font Size Programatically (VB.NET)

[vbnet]
Private Sub frm_Main_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
‘ Ctrl + + = increase the SQL size
If e.Control And e.KeyCode = Keys.Add Then
Using f As Font = TextBox1.Font
TextBox1.Font = New Font(f.FontFamily, f.Size + 1, f.Style)
End Using
Exit Sub
End If

‘ Ctrl + – = decrease the SQL size
If e.Control And e.KeyCode = Keys.Subtract Then
Using f As Font = TextBox1.Font
TextBox1.Font = New Font(f.FontFamily, f.Size – 1, f.Style)
End Using
Exit Sub
End If
End Sub
[/vbnet]