Results 1 to 3 of 3

Thread: rich text boxes

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    UK
    Posts
    506

    rich text boxes

    VB Code:
    1. Private Sub cmdAddText_Click()
    2. rtfTesting.Text = txtToAdd & vbCrLf & rtfTesting.Text
    3. rtfTesting.SelStart = 0
    4. rtfTesting.SelLength = Len(txtToAdd)
    5. rtfTesting.SelColor = vbRed
    6. End Sub
    when i click the command button, the top line of my textbox changes which it what i want but then ALL of the lines underneath it are reverted to the last colour of the top line? i've looked at the .TextRTF in a normal textbox and can see why this happens but i havent got a clue how to get round it anyone?
    - cheers
    Last edited by adzzzz; Dec 8th, 2002 at 06:29 PM.

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385
    adzzzz,


    try

    rtfTesting.SelLength = Len(txtToAdd & vbCrLf & rtfTesting.Text)

    instead of

    rtfTesting.SelLength = Len(txtToAdd)

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    UK
    Posts
    506
    that changes the colour of the whole textboox was my fault lol i'd made my question out wrong
    Last edited by adzzzz; Dec 8th, 2002 at 06:30 PM.

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