Jump to content
  • Advertisement
Sign in to follow this  
RedDragon0509

edit box inserting return

This topic is 4699 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'm using a windows edit box and I want to set its text to what I read in from a file, but it does not insert the returns so everything is on one line. example: in the file: hello goodbye in the edit box: hellogoodbye also if I just try setting the text using: SendMessage(hWnd_edit, WM_SETTEXT, 0, (LPARAM)"hello\ngoodbye"); it does not take the \n to mean return(or at least insert one), but \t inserts a tab. the edit box is created using: hWnd_edit =CreateWindowEx(0, "EDIT", "edit", ES_MULTILINE | ES_AUTOVSCROLL,600, 0,400,400,0,NULL,hInstance,NULL); any ideas on how to insert a return?

Share this post


Link to post
Share on other sites
Advertisement
The Windows edit box ignores new lines on their own. You may need to insert a carraige return/line feed pair. Basically, you need to include a \r as well.

There are a few reasons why Windows may be jerking you around, but I have certainly come across this one before. It's the root cause as to why Notepad can't hack Linux or Mac formatted text files.

Share this post


Link to post
Share on other sites
Sign in to follow this  

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