Solved

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

Posted on 2010-08-12
1
587 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 33

Accepted Solution

by:
jppinto earned 500 total points
ID: 33422907
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…

734 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