Jump to content
  • Advertisement

Archived

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

vallis

Multiline Win32 Text Box

This topic is 6713 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

Share this post


Link to post
Share on other sites
Nope - no difference unfortunately...nice try though

I''ve tried \n, \n\r and \r...

Anyone else know?

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
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

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
Guest Anonymous Poster
Actually I think you want \r\n not \n\r

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!