Write File content to a rich text box

Asked By Hema Moss
06-Sep-10 02:17 AM
Earn up to 0 extra points for answering this tough question.
Hi All,

    I have a requirement to read the file content and write it to a Rich textbox.

    I have tried converting byte[] to String by all Encodings(for ex: ASCII, UTF7,UTF8) but couldn't accomplish the task.

   Can anyone guide me with this issue...?
 

  re: Write File content to a rich text box

Peter Bromberg replied to Hema Moss
06-Sep-10 06:08 PM
Generally a RichTextBox control has two properties, RTF and Text.

RTF expects correctly formatted Rich Text which includes all the special RTF markup codes.
The Text property expects plain text without formatting codes.

If you are reading from a text file and it does not include RTF markup, then you have no choice but to assign your "stuff" to the Text property.
Create New Account