Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RichTextBox: Background colors for phrases

Status
Not open for further replies.

Jekteir

Technical User
Jul 25, 2001
27
GB
Hi, I'm working on a text-based client (MUD client) which interprets standard ANSI color codes. The program displays the colors in a RichTextBox with a black overall background color, and I have successfully implemented interpretation of foreground text color. However, there are also codes for background color - codes which are intended to affect only the background of the selected text, not the whole box, much as 'highlight' does in MS Word. However, I have been unsuccessful in producing this effect programatically.

I do know that it is possible to display such an effect, because if you go into MS Word and select a 'highlight color' for some text, and then copy and paste that text into a VB RichTextBox, it is displayed with the highlight in the richtextbox.

I have been unsuccessful with taking RTF codes from word files and incorporating them into the
Code:
.selRTF
at the end of the textbox data, primarily because the richtextbox just ignores the codes, and seems to work on different RTF file codes than Word does.

Can anyone help me with how to achieve this through the program? Thanks.

David Midgley
Game Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top