?
Solved

Richtextbox text

Posted on 2005-03-02
4
Medium Priority
?
307 Views
Last Modified: 2010-04-16
How can I display a text document within a richtextbox and it honor the line returns.  I have a document formatted like so:

"This is line 1\nthis is line2\nthis is line 3\tthis is a tab\nthis is line 4";

How can I display this string appropriately within a form.  Preferrably using a richtextbox.

Thanks,
Kendal
0
Comment
Question by:gvector1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
AaronReams earned 2000 total points
ID: 13442735
Hi gvector1,

By default, the richeditbox should accept \n and insert a line return in its place.  

input
-------
            string s = "This is line 1\nthis is line2\nthis is line 3\tthis is a tab\nthis is line 4";
            richTextBox1.Text = s;

output
-----
This is line 1
this is line2
this is line 3    this is a tab
this is line 4

Is that not working for you?


Regards -A.R
0
 
LVL 10

Expert Comment

by:ptmcomp
ID: 13443001
What is your Richtextbox displaying?
0
 

Author Comment

by:gvector1
ID: 13443769
Thank you all.  It was my fault.  I didn't realize until A.R's sample what I was doing wrong.  I was using @ in front of the string.  Once I removed @, it worked fine.  Thanks for the assistance.
0
 
LVL 8

Expert Comment

by:AaronReams
ID: 13443808
No problem.   Cheers -A.R.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question