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
2009-09-10 22:21:04
That did it, thanks!
Cyclone
2009-09-10 23:13:49