[RESOLVED] SelLength Problem.
I'm using this piece of code to select a small length of text on my text box.
Code:
Private Sub Command1_Click()
Dim lngPos As Long
Dim searchText As String
searchText = Text1.Text
If searchText = "Find what?" Then Exit Sub
lngPos = InStr(1, txtData.Text, searchText, vbTextCompare)
If lngPos > 0 Then
Text1.BackColor = &H80FF80
txtData.SelStart = lngPos - 1
txtData.SelLength = Len(searchText)
Timer1.Enabled = True
Command2.Visible = True
Else
Text1.BackColor = &H8080FF
Timer1.Enabled = True
End If
End Sub
It seems to be working alright, but I can't see the area of text being selected. I mean, if the text is there, the back of the search box shows up green, like i've set it up to do and if it's not, it shows up red. I just cant see area of text being selected. It's strange...
Any ideas?
Syrillia