Multiline Win32 Text Box
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
Change the ''\n'' to a ''\r'' and that will probably fix it.
If not, then its beats the s**t out of me.
I guess this is where most people put a famous quote...
"Everything is funnier with monkey''s" - Unknown
If not, then its beats the s**t out of me.
I guess this is where most people put a famous quote...
"Everything is funnier with monkey''s" - Unknown
--------------------------I guess this is where most people put a famous quote..."Everything is funnier with monkey''s" - Unknown
Nope - no difference unfortunately...nice try though
I''ve tried \n, \n\r and \r...
Anyone else know?
I''ve tried \n, \n\r and \r...
Anyone else know?
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
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
--------------------------I guess this is where most people put a famous quote..."Everything is funnier with monkey''s" - Unknown
Have you set it up to specifically be multi-line? If your using VC++''s resource editor, there should be a check box somewhere in the property page.
--TheGoop
--TheGoop
March 30, 2000 09:30 PM
Instead of using the \n explicitly, try using hex characters:
wsprintf((char*)&Buffer, "Line 1%c%c", 0x0a, 0x0d);
wsprintf((char*)&Buffer, "Line 1%c%c", 0x0a, 0x0d);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement