开发者

C# LoadFile font and formatting

How can I load a file in a c# app so that I can see it formatted.

If I use:

richTextBox2.LoadFile("a.txt", RichTextBoxStreamType.PlainText);

I did it with:

开发者_JAVA百科
textBox2.Text = File.ReadAllText("a.txt");

The text is not formatted at all, new lines and CR's are totally missing, also the tabs

also the file open ok in notepad, but it opens bad in wordpad

Can I load the file in a textbox? (use multi-line)


Have you tried loading it as RichText?

richTextBox2.LoadFile("a.rtf", RichTextBoxStreamType.RichText);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜