I am trying read each line in a textbox individually and check if it contains a certain string. This will be used in the textchanged event of the textbox to check for a certain string and it will execute it’s corresponding code if found.
I cant get it working right though. Here is my code.
Dim txt As FastColoredTextBox = TryCast(page.Controls(0), FastColoredTextBox)
For Each line As Line In txt.Lines
If CBool(InStr(line.ToString(), "<vb>")) Then
txt.Language = Language.VB
End If
So I am guessing you’re using the FastColoredTextBox from the CodeProject.com site, right?
Try splitting the Text of the text box into its corresponding lines first: