Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-08-12
1
Medium Priority
?
598 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 2000 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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 shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

972 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