Archived

This topic is now archived and is closed to further replies.

vallis

Multiline Win32 Text Box

Recommended Posts

I have a multiline win32 text box, but I can't seem to get a new line on it from my code. At the moment, my code is like this: char Buffer[1024] = {0}; wsprintf((char*)&Buffer, "Line 1\nLine 2\nLine 3\nLine 4\n"); SetDlgItemText(hDlg, TEXT_BOX, Buffer); I just get a square symbol (it won't print on the message board) instead... I guess it's just something other than \n, but does anyone know what exactly? Edited by - vallis on 3/30/00 6:36:07 PM

Share this post


Link to post
Share on other sites
Hmm.. Well. Try this:

1. Run program.
2. Use the edit box and put "line1line2"
3. Get the text from the edit box.
4. Use debugger to see what the newline character stuff is.


I guess this is where most people put a famous quote...
"Everything is funnier with monkey''s" - Unknown

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Instead of using the \n explicitly, try using hex characters:

wsprintf((char*)&Buffer, "Line 1%c%c", 0x0a, 0x0d);

Share this post


Link to post
Share on other sites