[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 540
  • Last Modified:

Change underline colour in Rich Text Box

Is there anyway to change underline colour in a RichTextBox, like Word does when the the AutoSpellcheck is on????
0
PeteD
Asked:
PeteD
1 Solution
 
ScottNeroCommented:
Unfortunately, the Microsoft RichTextBox seems to ignore the \ulc directive. In Microsoft Word you can read RTF files which have directives such as:

\ul\ulc7 (shows up with yellow underline)
\ul\ulc5 (shows up with green underline)

However, when loading this same thing into the RichTextBox, the underlines all come out as black, leading me to the assumption that it does not support this functionality.
0
 
JanusFuryCommented:
I believe that's because the GDI font system doesn't allow for special-colored underlines. Word does this manually.
It's not too hard to draw a colored underline yourself, however I don't know how hard it would be to do so in a richtextbox (Probably would require a LOT of subclassing).
0
 
PeteDAuthor Commented:
gotta end this....... thanks anyway
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now