TextBox allows '\ n' to be a carriage return

Textboxes created by "CreateWindowEx (WS_EX_CLIENTEDGE," EDIT "," ", ES_MULTILINE .." will require \ r \ n for a newline. Im redirecting my stdoutput to this textbox which only uses "\ n" to specify a newline . and I don't want to replace all '\ n' with '\ r \ n' is there no way to allow '\ n' to output a newline to text fields?

THH

0


a source to share


3 answers


I'm sure what you're asking is not possible (i.e. there is no magic tweak to make Windows controls accept Unix-style newlines).



+2


a source


Not sure which language you are using, but why not just do this (VB.NET example):

TextBox1.Text=TextBox1.Text.Replace("\r\n","\n")

      



This should replace all "\ r \ n" occurrences with only "\ n"

+1


a source


\ r \ n is not a newline. It's carriage return + newline. These are two different things. This probably means more people working in the console world because you can branch to a new line without going to character position 1.

0


a source







All Articles