add new line

  • Thread starter Thread starter Aaron
  • Start date Start date
A

Aaron

how do i add a new line?
string a = a + (U+000D); //doesnt work

can someone help me translate this html code into a c# string?
<font color="red">hello</font>world<br>

Thanks in advance
 
Aaron said:
how do i add a new line?
string a = a + (U+000D); //doesnt work

Well, there's "\r" which is carriage return, and "\n" which is
linefeed. Often you'll want both - but that depends on the context.
What are you trying to add a new line to?
can someone help me translate this html code into a c# string?
<font color="red">hello</font>world<br>

What do you mean, exactly?
 
You can use:

Environment.NewLine

Using this syntax results in more portable code.

Regards,

Bennie Haelen
 
can someone help me translate this html code into a c# string?
<font color="red">hello</font>world<br>

-What do you mean, exactly?

I would like to display the word hello in red and world in default font and
a linebreak in a windows form textbox.
something like this
textbox1.text = font.color="red" +"hello" + font.default="world" + "/r"
//pseudo code

thanks
 
Aaron said:
-What do you mean, exactly?

I would like to display the word hello in red and world in default font and
a linebreak in a windows form textbox.
something like this
textbox1.text = font.color="red" +"hello" + font.default="world" + "/r"
//pseudo code

I don't believe normal textboxes can have multiple colours in. However,
have a look at the RichTextBox control.
 
Back
Top