Archived

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

Raskolnikov

Newlines ignored when setting Edit box text

Recommended Posts

I am new to win 32 api programming and am having trouble with edit boxes. I am implementing various graphics algorithm from a book. Each algorithm has a dialog box that allows the user to set pramaters, and a "veiw source" button that opens another dialog box and displays the algorithms source in an edit box. Here is my problem. When I send the string with the appropriate source code to the edit box the newlines are printed as black bars and all the formating is lost. The edit box is set to multiline and if I type in it carrige returns work as expected, but when I send a string they are printed as black bars instead. I tried \n \f \r \v nothing seems to work. If I use a MessageBox the newlines work, but then I can cut and past the source code. Is there anywhar to set the text of an edit box and have newlines work! EDITTEXT IDC_EDIT,15,18,214,186,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL char str[] ="line1\n\n\r\r\f\f\v\vstill on same line" SetDlgItemText(hdwnd, IDC_EDIT, sourceStr);

Share this post


Link to post
Share on other sites
If you have a question about how to use any Microsoft APIs (or apps for that matter) a great place to go is the Microsoft forums available from the MS website (the news server is msnews.microsoft.com).

Share this post


Link to post
Share on other sites