更新时间:2022-12-20 10:34:35
如果它是多行文本框,则此代码将有所帮助:
If it is a multiline textbox, this code will help:
int line = textBox1.GetLineFromCharIndex(textBox1.SelectionStart) + 1;
int col = textBox1.SelectionStart - textBox1.GetFirstCharIndexOfCurrentLine();