Results 1 to 3 of 3

Thread: Text Highlighting

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2007
    Location
    Merced
    Posts
    868

    Text Highlighting

    Hi I was messing around with a richtextbox and I was wondering if there is a way where I can highlight a specific line or row if you want to call it. This will include all the text in that line.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Text Highlighting


  3. #3
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: Text Highlighting

    GDO, this wil chage font color of currnt line
    Code:
    Dim lBegin As Long, lEnd As Long
    Dim CurPos As Long
    With RichTextBox1
        CurPos = .SelStart
        If CurPos = 0 Then CurPos = 1
        
        'Find line begin and end
        lBegin = InStrRev(.Text, vbCrLf, CurPos)
        lEnd = InStr(CurPos, .Text, vbCrLf)
        
        If lBegin = 0 Then lBegin = -1
        If lEnd = 0 Then lEnd = Len(.Text) - 1
        
        .SelStart = lBegin + 1
        .SelLength = lEnd - lBegin
        .SelColor = vbRed
    End With
    just check and feedback me
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


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