2011-07-31 51 views

回答

2
richTextBox1.SelectionLength = 0; 
richTextBox1.SelectedText = "//"; 
0
richTextBox.GetCharIndexFromPosition(Point point) 

會給你字符索引。

另一種方法,可以幫助你:

richTextBox.GetFirstCharIndexFromLine(int lineNumber); 
richTextBox.GetFirstCharIndexOfCurrentLine(); 
richTextBox.GetLineFromCharIndex(int index); 
相關問題