Visual C++ txtBox newline?

Jul 13, 2011 at 7:20pm
Hello all, new guy here. I have a Visual Studio Express 2010 C++ windows forms project going where I need to write text to a textbox. The problem I am having is with the new line or carriage return, cant seem to get it to work. I have tried \r\n and Environment::Newline but neither are working for me. I have also made sure that the txtbox is set for multiline. I am guessing this problem has to do with me using the express version. Any help would be greatly appreciated.
Jul 13, 2011 at 9:51pm
closed account (3hM2Nwbp)
 
(chr(10) + chr(13)) // should work for you. 
Jul 14, 2011 at 12:15pm
Thanks Luc, I tried that but the compiler doesnt know what to do with the "chr". Maybe I am missing an include.
Jul 14, 2011 at 3:13pm
closed account (3hM2Nwbp)
Ah, sorry.

Chr(10) + Chr(13)

should be the proper syntax.
Jul 14, 2011 at 9:01pm
Chr(10) + Chr(13)

This does not work either. Not sure what the problem is, maybe a missing library?
Jul 14, 2011 at 9:26pm
Jul 16, 2011 at 1:41pm
I was not using "+=" when entering text. So anytime text was written, it completely overwrote the original text rather than adding to it. Thank you all for your help.
Topic archived. No new replies allowed.