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

How to create the find option similar to notepad..?urgent

Moderator: dafunkymunky

How to create the find option similar to notepad..?urgent

Postby blackwidow on Tue May 13, 2008 5:52 am

i have created the code..but it selects only the first text..for example
if I enter HelloWorldHello and request Hello to be selected...only the first part is selected..
Option Explicit

Private Sub Command1_Click()
Dim i As Integer
i = InStr(1, Text1.Text, Text2.Text)
If i = 0 Then
MsgBox "String not found"
Else
Text1.SetFocus
Text1.SelStart = i - 1
Text1.SelLength = Len(Text2.Text)
End If
End Sub
blackwidow
 
Posts: 0
Joined: Tue May 13, 2008 5:34 am

Postby sendtoanurag on Mon May 19, 2008 4:52 am

Coz that's what u,ve written
The variable i here selects the first instance of Hello and selects only that
In fact write the code to loop thru varuable
sendtoanurag
 
Posts: 29
Joined: Tue Mar 18, 2008 2:51 pm


Who is online

Users browsing this forum: No registered users and 5 guests