0

I want to display and edit serial data (e.g. NULL, STX, ETX, ENQ, etc. characters) in the text box in WPF. It should be displayed same like Notepad++ as shown here.

Control Characters

I have tried using textbox, RichTextBox in WPF, but only printable characters are shown. Non printable characters (e.g. NULL, STX, ETX, ENQ, etc. characters) are not shown. Will you please guide me how can I display this?

Jackdaw
  • 7,626
  • 5
  • 15
  • 33
Victory
  • 1
  • 1
  • 1
    First of all, you should not be using a TextBox when you only want to display but not edit a string. Use a TextBlock instead. The way how those characters are shown is up to you. Just replace them in the source string by something you'd like to see, e.g. `var result = source.Replace("\n", "")`. – Clemens Jan 25 '22 at 14:38
  • @Victory: What is the source document format that you try to display/edit? And if you are going to edit the data what format you want to use to save it? – Jackdaw Jan 26 '22 at 06:54
  • @Jackdaw It will be a text file containing combination of printable and non printable characters. – Victory Jan 26 '22 at 09:29

0 Answers0