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

  • Thread starter Thread starter Leon_Amirreza
  • Start date Start date
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
 
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
 
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...
 
Back
Top