RichTextBox.Find method strt/end integer arguments

How do I get around the RichTextBox.Find methods integer start argument when I want to find a string with the cursor being past the 32k mark? I am using this with a 'find' and a 'find next' type menu command. (like in all text editors)
Who is Participating?
thalemConnect With a Mentor Commented:
Use Long instead of integer. I've done it, and it works well.
There is therefore no 32k limitation. Yeap. It's that simple.

Hello i am YiannisVolos. My answer for your question. I designed a special code for making FindNext(Find). It makes the same work. If you want you can change the given code, if you make changes which make it more powerful please e-mail it to me. Thank you.

In your button click paste the following source code.(the code is visual basic).
a) add a textbox on a form.
b) add a command button
c) and a RichTextBox that it will contain the text of your user
If TextBox.Text <> "" Then
FoundPosition = InStr(Start + 1, UCase$(HomeEditor.richtextbox1.Text), LCase$(TextBox.Text))
If FoundPosition <> 0 Then
richtextbox1.SelStart = FoundPosition - 1
richtextbox1.SelLength = Len(TextBox.Text)
Start = FoundPosition

If TestTimes = 1 Then
Response = MsgBox("Your program could not find the given text.", 0, "Your program title - Error Message")
Start = 0
Start = 0
TestTimes = 1
GoTo StartFind
End If
End If
End If

my email:
please increase the award points
cristopherAuthor Commented:
Your solution is the same as mine. It will not work over 32k. Could it be that the SelLength and SelStart properties of the RichtextBox are integers also?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.