tags:

views:

548

answers:

1

How do you find the location of the little blinking cursor where the user can type, column and row? I couldn't find this anywhere.

+2  A: 

If you mean WinForms, use the SeletionStart property to access the current position of the carret. Here is code to get the index, current line and current column.

int index = myTextBox.SelectionStart;
int currentLine = myTextBox.GetLineFromCharIndex(index);
int currentColumn = index - myTextBox.GetFirstCharIndexFromLine(currentLine);
Patrik
That did it, thanks!
Cyclone