As far as I know the above method is the only sure way to do it in .NET without having to go through a lot of code logic that can easily be broken. In my example above I was assuming you would use a non zero line index, if you wish to use a zero based index than change this line:
Return SendMessage(hwnd, EM_LINEINDEX, lineNumber + 1, 0)
to
Return SendMessage(hwnd, EM_LINEINDEX, lineNumber, 0)
Let me know if you need more help but this should do what you want.