Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I know how to create an edit control using predefined microsoft window classes. And I know that I can insert text into that edit control using SetWindowText or using WM_SETTEXT. But I don't know how to add texts with new lines. And Also ASCII control characters don't work. Need help.

NOTE:
I'm using C++ Win32 without MFC.
I am creating the control in a dialog box.
Posted
Updated 30-Aug-12 4:09am
v2
Comments
[no name] 18-Aug-12 8:19am    
Did you set your edit control to be multiline?
Captain Price 18-Aug-12 12:35pm    
yep, i did.
Sergey Alexandrovich Kryukov 18-Aug-12 14:01pm    
Please add C++ to your tags.
--SA
Captain Price 1-Sep-12 12:35pm    
i already have, so wassup ?
Sergey Alexandrovich Kryukov 18-Aug-12 14:02pm    
The problem is not clear. What could help is your absolutely minimized but complete code sample?
--SA

1 solution

It was a while ago but I remember that the edit control must have the ES_MULTILINE style and instead of '\n' you must use '\r\n' for line breaks.
 
Share this answer
 
Comments
Captain Price 1-Sep-12 12:32pm    
oh, i searched for hours, but found nothing. Thanks yo !
Michael Haephrati 26-May-20 13:33pm    
@JMatthews Checked your solution and it works!
JJMatthews 27-May-20 4:29am    
glad to help brother

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900