Solved

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

Posted on 2010-08-12
1
583 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
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 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