Link to home
Start Free TrialLog in
Avatar of cristopher
cristopher

asked on

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)
Avatar of YiannisVolos
YiannisVolos

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).
-S-T-E-P-S------------------------------------------------------------------------------------
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
---------------------------
StartFind:
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
Else


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








my email: volosm@cytanet.com.cy
please increase the award points
Avatar of cristopher

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of thalem
thalem

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial