0

リッチテキストボックスで強調表示された単語の行番号を取得する方法はありますかここではリッチテキストボックスでテキストを強調表示するコードです

例えば

  i am  *doing code for *practice 
  this is very hard *language 
  its very *good day

(*) マークが付いている単語は、強調表示された単語を示します

私は外に出ようとしています

行番号 1 : 行番号を実行します。1 : ライン番号を練習します。2 : 言語行番号 3 : 良い

ここにリッチテキストボックス内の単語を強調表示する私のコードがあります

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
4

0 に答える 0