tags:

views:

249

answers:

2

I have a line of text in a textblock that reads:

"Detected [gesture] with an accuracy of [accuracy]"

In WPF, is it possible for me to be able to change the color of the elements within a textblock? Can I have a textblock be multiple colors? For example, I would like the whole TextBlock to be black except the gesture name, which I would like to be red.

Is this possible in WPF?

A: 

you can use a RichTextBox for that and set IsReadOnly = true

viky
+3  A: 

See if this helps:

 <TextBlock>
      Detected
      <TextBlock Text="{Binding Gesture}" Foreground="Red" />
      with an accuracy of
      <TextBlock Text="{Binding Accuracy}" />
 </TextBlock>
wpfwannabe