Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2003

Tip: Looking for answers? Try searching our database.

Escape characters in RichTextBox....

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sinex - 25 Sep 2003 13:10 GMT
Hi !
I have a form. The form has a textbox and a richtextbox.
There is a button also. When the button is clicked,
whatever text was typed into the text box, must be copied
to the richtextbox.

At runtime, I enter the following string into the text
box:
Hi\nHello\nHow\nDo\nYou\nDo

Then I click the button. In the richtextbox I am expecting
Hi
Hello
How
Do
You
Do

But what I get is:
Hi\nHello\nHow\nDo\nYou\nDo

Ne idea to workaround this probs?

...Sinex
Michael \(michka\) Kaplan [MS] - 25 Sep 2003 16:06 GMT
When entered through the keyboard as text into the control, they are not
escape characters -- they are just regular characters. So what you see is
expected. Are you looking to create code that will treat text as something
to parse and thus will treat the backslash as a character escaping function
generically?

Signature

MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.

> Hi !
> I have a form. The form has a textbox and a richtextbox.
[quoted text clipped - 20 lines]
>
> ...Sinex
T.Fischer - 01 Oct 2003 00:05 GMT
>-----Original Message-----
>Hi !
[quoted text clipped - 22 lines]
>....Sinex
>.

use

String s1=Regex.Unescape(textBox1.Text);

and put s1 in your RichTextBox

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.