Results 1 to 3 of 3

Thread: [RESOLVED] SelLength Problem.

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2007
    Posts
    85

    Resolved [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
    Last edited by syrillia; Feb 27th, 2009 at 11:37 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width