Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Richtextbox text

Posted on 2005-03-02
4
Medium Priority
?
315 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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

604 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