Results 1 to 2 of 2

Thread: RichTextBox query

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    11

    Question RichTextBox query

    I am trying to write something that will find a word, and highlight it in bold, in some user-entered text.

    I am using a richtextbox.

    So far I have:

    Private Sub Command1_Click()


    If InStr(rtbUserText, txtSearchString.Text) Then

    rtbUserText.SelText = txtSearchString.Text
    rtbUserText.SelBold = True

    Else
    MsgBox "Word not found"
    End If
    End Sub

    When run, clicking the command button makes the word that is to be found appear on the end of the text in the rtb, but not in bold.

    I know that there is something wrong here, but I don't know what! Can anyone help? I just want to highlight the word in bold if it is present, to show that it's been found.

  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Try finding the start of the word then select it use length...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

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