Solved

Different font color within a single WPF System.Windows.Controls.Textbox

Posted on 2010-08-12
1
574 Views
Last Modified: 2013-11-12
I have a single WPF System.Windows.Controls.Textbox and I'm wondering if there is a way to have parts of the text in different font colors.  My text consists of control characters and I'm trying to distinguish them from the remaining text string.  Can this be done with this control or any other similar Textbox control in WPF?
0
Comment
Question by:Keith3679
1 Comment
 
LVL 33

Accepted Solution

by:
jppinto earned 500 total points
Comment Utility
With a TextBox you're stuck with one color. You would have to use the RichTextBox (http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox.aspx) for that.

Take a look at this article that will help you do what you're trying to do:

http://blogs.microsoft.co.il/blogs/tamir/archive/2006/12/14/RichTextBox-syntax-highlighting.aspx

jppinto
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now