How can I set the character that a TextBox may Interpret as NewLine?!

L

Leon_Amirreza

Hi,
how can I have a .Net Control like (TextBox or Label) to interpret a unicode
character (or a sequence off characters) to be interpreted as newline?

I need Somthing like this:

textBox1.NewLineString = "+\";
textBox1.Text = "Jack+\Bill";

to be shown like this inside the textbox:

Jack
Bill
 
F

Family Tree Mike

Leon_Amirreza said:
Hi,
how can I have a .Net Control like (TextBox or Label) to interpret a unicode
character (or a sequence off characters) to be interpreted as newline?

I need Somthing like this:

textBox1.NewLineString = "+\";
textBox1.Text = "Jack+\Bill";

to be shown like this inside the textbox:

Jack
Bill

That's a really strange request. Here is why.

Suppose, for whatever reason, your new line character is set to "+\". Now a
user types in the textbox "We have 10 oranges +\12 bananas", and reallize
they meant "10 oranges + 12 bananas". You need to detremine they deleted the
newline, and put back the first portion of the newline string. I'm sure it
can be done somehow, but is this something your users really need?

Mike
 
P

Patrice

Hi,

What if you just replace +\ with \n ?

If you really want to keep this particular sequence you could also implement
this in your own textbox control to do the transform when the text property
is written/read...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top