Results 1 to 5 of 5

Thread: Changing RichTextBox's selection color

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    11

    Smile

    Hello everyone,

    Does anybody know how to change the rich text box's selection color? (By default it's black) How about hilighting text?

    Any suggestions appreciated,
    Thanks
    Alex Begey
    CrystalDev
    VB6 SP4

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    TO change the colour of selected text use the SelColour property.

    to highlight a bit of text you set the start position using selStart, and the length using selLength

    Code:
    'highlights the first 5 characters
    RichTextBox1.SelStart = 1
    RichTextBox1.SelLEngth = 5
    
    'and sets them to blue
    RichTextBox1.SelColor = vbBlue
    Iain, thats with an i by the way!

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    11

    Smile

    Thanks Iain for the answer, but that's not what I'm looking for.

    I'm trying to find a way of hilighting (not coloring) text in the rich text box in a different color than black (it's default hilighting color.)

    Thanks again,
    Alex Begey
    CrystalDev
    VB6 SP4

  4. #4

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    11

    Smile

    Owner drawing the control would probably be too complicated...
    But I'm almost certain that there's an easier way.

    Any ideas?
    Alex Begey
    CrystalDev
    VB6 SP4

  5. #5

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