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)
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.richtext
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