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

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -