It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

rich text box headache

Moderator: dafunkymunky

rich text box headache

Postby mike7510uk on Mon May 02, 2005 7:00 pm

--------------------------------------------------------------------------------

I have a rich text box on my form and have already loaded the .rtf file into it with no problems. I now need to search the opened file, this seems to work but it only displays the first instance of the word.
mike7510uk
 
Posts: 4
Joined: Sat Apr 30, 2005 11:18 am

Postby dafunkymunky on Wed May 04, 2005 7:47 am

once you get the text set focus of the cursor to that position and then find again this will search only the part of the document which is after the cursor

this must do the job

if you want the exacty code i wont mind giving it to you,JUST REPLY

--DAFUNKYMUNKY
--------DAFUNKYMUNKY--------
::THE::NECESSARY::[D]EVIL::
....errr i mean munky....
User avatar
dafunkymunky
100+ Club
 
Posts: 183
Joined: Fri Apr 08, 2005 7:32 am
Location: India

Postby dafunkymunky on Wed May 04, 2005 7:58 am

This is an example code::

//declare as global variable
Static CurPos As Long, FindString As String

//search function
CurPos = RichTextBox1.Find(FindString, Curpos)
If CurPos = -1 Then
MsgBox "Not found"
Else
RichTextBox1.SetFocus
CurPos = CurPos + Len(StringToFind)
End If

i'm not very sure of the code but you must have understood what to do

__DAFUNKYMUNKY
--------DAFUNKYMUNKY--------
::THE::NECESSARY::[D]EVIL::
....errr i mean munky....
User avatar
dafunkymunky
100+ Club
 
Posts: 183
Joined: Fri Apr 08, 2005 7:32 am
Location: India


Who is online

Users browsing this forum: No registered users and 1 guest