Replies: 1 comment
-
In short, this behavior is because TextBox internally uses RichEdit to implement all of the complex textbox behavior, and the default behavior of RichEdit is to use just CR at line breaks. You can find some comments on that here: about rich edit controls RichEdit can be asked to convert for CRLF or LF for some APIs, but I believe internally it always stores as just CR. I think LF would probably be the best choice if this was a new control, but the default can't be changed now without a huge compatibility break. For those conversion scenarios, when using |
Beta Was this translation helpful? Give feedback.
-
I've noticed that whenever text is added to a TextBox (i.e. setting the Text property), all of the new lines are replaced with CR (\r) line feeds. This can cause problems as various applications don't recognise these as new lines but do recognise CRLF (\r\n), such as batch files for example. As far as I know, the default for Windows is usually CRLF, so why does the TextBox use CR (which is used by MacOS)? Why not use CRLF or just keep the new lines as they were?
I was wondering if anyone knows anything about this behaviour? I can't find a huge amount of info on this other than this issue report and this. But there's no solutions or even confirmation that this is a bug or intentional behaviour. It seems like this used to work properly but was broken in a Windows 10 feature update.
Beta Was this translation helpful? Give feedback.
All reactions