| View previous topic :: View next topic |
| Author |
Message |
blackwidow
Joined: 13 May 2008 Posts: 1
|
Posted: Tue May 13, 2008 6:52 am Post subject: How to create the find option similar to notepad..?urgent |
|
|
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 |
|
| Back to top |
|
 |
|
|
sendtoanurag
Joined: 18 Mar 2008 Posts: 28
|
Posted: Mon May 19, 2008 5:52 am Post subject: Re: How to create the find option similar to notepad..?urgent |
|
|
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 |
|
| Back to top |
|
 |
|