[HELP] RichTextBox.Append()
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
4 posts
Page 1 of 1
ok here is my problem.
i have a IRC Client that i am working on. Everything works great cept one thing.
Im having trouble when a line is append("")ed to the richtextbox control.
here is the idea.
say, the Appended line contains ("Hey you guys, where did Bob go?")
now let say i wanted to just Find() words in that last line.
(Not the whole richtextbox) - this lags after about 75 lines.
lets say the words i want to Find() are: guys, where, & Bob.
any ideas?
i have a IRC Client that i am working on. Everything works great cept one thing.
Im having trouble when a line is append("")ed to the richtextbox control.
here is the idea.
say, the Appended line contains ("Hey you guys, where did Bob go?")
now let say i wanted to just Find() words in that last line.
(Not the whole richtextbox) - this lags after about 75 lines.
lets say the words i want to Find() are: guys, where, & Bob.
any ideas?
You could try by isolating the last line of the RichTextBox, like so:
Code: Select all
Then you could use the Find() function on lastLine cooll;Dim lastLine As String
Dim rtbLines As Integer = RichTextBox1.Lines.Length
lastLine = RichTextBox1.Lines(rtbLines - 1)
Try this
Code: Select all
You can add as many words as you want.For Each fMatch As Match In Regex.Matches(RichTextBox1.Lines(RichTextBox1.Lines.Length - 1), "\b(guys|where|Bob)\b")
MessageBox.Show(fMatch.Value)
Next
You can find me on Facebook or on Skype mihai_92b
XTechVB wrote:Try thisthis worked get.Code: Select allYou can add as many words as you want.For Each fMatch As Match In Regex.Matches(RichTextBox1.Lines(RichTextBox1.Lines.Length - 1), "\b(guys|where|Bob)\b") MessageBox.Show(fMatch.Value) Next
ill need to check it with 500 lines or more to see if it still is laggy but seems to work like i need it to.
+rep ya!
scottie
4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023