0

The following comes from my Ticket.OrderDetatils which is a string, i can bind to a textblock no problem.

1  BOWL CHICK SP  1

1  COBB SALAD     1
<SPAN Foreground="Red">    1000</SPAN>
<SPAN Foreground="Red">    1000</SPAN>

1  DIET COKE      1

1  TACO SALAD     1
<SPAN Foreground="Red">    1000</SPAN>
<SPAN Foreground="Red">    1000</SPAN>

I would like to know if anyone can help me do the spans to the already bind to the textbox. it displays it as plain text, I want those portions of the text formatted in red color only. Thanks in advance Armando

<TextBox Text="{Binding OrderDetails}" SnapsToDevicePixels="True" seLayoutRounding="True" Margin="3" Grid.Row="2"/>
  • Can't you use a WebBrowser control - wrap the text so its in valid html and the spans will render correctly. – JimBobBennett Jun 18 '14 at 22:39
  • http://stackoverflow.com/questions/13305602/html-formatting-in-richtextbox ?? – Divi Jun 18 '14 at 23:00
  • Is this textbox editable or just for display? – Divi Jun 18 '14 at 23:02
  • Hi, thanks for your responses. The text box is just for displaying the order details. I can bind it no problem, but the whole text box is in one color. I would like to display the lines in the span section in red. I thought about the Web browser control, didn't think it was the proper approach, you see the text block is part of a data template and I thought using a Web browser was not a good idea. All the data is coming through a tcplistener, network stream sockets and the like. This is the only formating I would like to do display those lines in different color. – Armando Ruiz Jun 19 '14 at 02:47
  • By the way I don't have to save anything to a database. This is for a kitchen display system ticket bumper which replaces a kitchen printer and paper of course. – Armando Ruiz Jun 19 '14 at 02:50

0 Answers0