有没有办法在richtextbox中获取突出显示的单词的行号,这是在richtextbox中突出显示文本的代码
例如
i am *doing code for *practice
this is very hard *language
its very *good day
带(*)标记的单词表示突出显示的单词
我正试图摆脱
行号1:做 行号1:练习 行号2:语言 行号3:好
这是我的代码,用于突出显示richtextbox中的单词
Dim len As Integer = txtMbox.TextLength
For Each word As String In MisSpelledList
Dim lastindex = txtMbox.Text.LastIndexOf(word)
Dim index As Integer = 0
While index < lastindex
txtMbox.Find(word, index, len, RichTextBoxFinds.None)
txtMbox.SelectionBackColor = Color.Red
index = txtMbox.Text.IndexOf(word, index) + 1
End While