Quote Originally Posted by jmcilhinney
I don't think you understand what I mean. Let me be explicit.
VB Code:
  1. Dim rowIndex As Integer = 0
  2.         Dim colIndex As Integer = Me.TextBox1.SelectionStart
  3.  
  4.         For Each line As String In Me.TextBox1.Lines
  5.             'Check whether the caret is in the current line.
  6.             If colIndex <= line.Length Then
  7.                 'The caret is not in the current line.
  8.                 Exit For
  9.             Else
  10.                 rowIndex += 1
  11.  
  12.                 'Subtract the length of the current line including the line break.
  13.                 colIndex -= (line.Length + 2)
  14.             End If
  15.         Next line
  16.  
  17.         MessageBox.Show(String.Format("Row: {0}, Column: {1}", rowIndex + 1, colIndex + 1))
My god, Jm! No need for API with code like that, much better!