Results 1 to 2 of 2

Thread: Rich Text Box

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344

    Rich Text Box

    Lets say I have a rich text box..
    rtbMessage
    all the text in the box is black...
    is there anyway to make the last line red.....

    rtbMessage.lastline = vbred 'wish it was this easy ;o\
    -RaY
    VB .Net 2010 (Ultimate)

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    this will first check to make sure the last char is not a VBCRLF if it
    is the replace it with nothing.
    then highlight the last line and mak eit red
    Code:
    RTB1.SelStart = Len(RTB1.Text) - 1
    RTB1.SelLength = 1
    If RTB1.SelText = vbCrLf Then RTB1.SelText = "" 'check for enter at the end..if it is there..then clear it
    x = InStrRev(RTB1.Text, vbCrLf)
    Ln = (Len(RTB1.Text) - x) + 1
    RTB1.SelStart = x
    RTB1.SelLength = Ln
    RTB1.SelColor = vbRed
    VBBrowser v2.2.4
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

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