Solved

RichTextBox.Find method strt/end integer arguments

Posted on 1997-04-03
3
174 Views
Last Modified: 2012-08-13
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)
0
Comment
Question by:cristopher
3 Comments
 
LVL 1

Expert Comment

by:YiannisVolos
ID: 1425028
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
0
 

Author Comment

by:cristopher
ID: 1425029
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?
0
 

Accepted Solution

by:
thalem earned 100 total points
ID: 1425030
Use Long instead of integer. I've done it, and it works well.
There is therefore no 32k limitation. Yeap. It's that simple.

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question