c# - WPF continouous Text -


which element good, if continouous text com , want display in box,like textbox.

i want keep old text add in new line like:

com data1: 0xff 14:10 pm com data1: 0xa3 14:10 pm com data1: 0x12 14:11 pm .... 

if use textbox ,

txtbox.text = comdata; 

it replace older text.

thx

you can do:

txtbox.text = txtbox.text + environment.newline + comdata; 

you can use stringbuilder string concatenation like:

stringbuilder sb = new stringbuilder();  public void yourmethod() {   sb.append(comdata);   sb.append(environment.newline);   txtbox.text = sb.tostring(); } 

(why use stringbuilder see: stringbuilder vs string.concat)


Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -