Results 1 to 3 of 3

Thread: [RESOLVED] Select after searching for VbCrLf

  1. #1

    Thread Starter
    Lively Member feneck's Avatar
    Join Date
    Mar 2007
    Location
    Australia, Queensland, Gympie
    Posts
    85

    Resolved [RESOLVED] Select after searching for VbCrLf

    hey guys.

    My program searches through a text box looking for all 'VbCrLf' (enter). It finds 5. What i want it to do is select one of them, it dosnt really matter what one. I just need to no how to do this.

    (and yes, i cant select nothing, because thats what enter is, i just want the little black line to be there, as if its ready to type from that position.
    My Code:
    Code:
    Private Sub Command1_Click()
    MsgBox (InStr(Text1.Text, vbCrLf))
    End Sub
    Thanks
    Fen

    REMEMBER TO RATE

  2. #2
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    Re: Select after searching for VbCrLf

    Code:
    Private Sub Command1_Click()
        If InStr(1, Text1.Text, vbCrLf) > 0 Then
            Text1.SelStart = InStr(1, Text1.Text, vbCrLf)
            Text1.SetFocus
        End If
    End Sub

  3. #3

    Thread Starter
    Lively Member feneck's Avatar
    Join Date
    Mar 2007
    Location
    Australia, Queensland, Gympie
    Posts
    85

    Re: Select after searching for VbCrLf

    sweet thankyou

    REMEMBER TO RATE

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