How to add a string into edit control properly??

The id of an edit control is IDC_ABC.

The steps that i want to do is like this.

1. Retrieve string from Edit contorl.
2. Add the string i got on step 1 into Edti contorl.

so, i did like this.
* Supposed, IDC_ABC contorl has "Hello \n world \n cplusplus"
CString str;
GetDlgItem(IDC_ABC)->GetWindowText(str);
AfxMessageBox(str);
< result >
Hello
world
cplusplus

GetDlgItem(IDC_ABC)->SetWindowText(str);
< result >
Hello world cplusplus

Second result is not what I want.
I mean, it didn't have endline("\n")

How to do it??
Set ES_WANTRETURN style for the edit control and use CRLF as line terminator instead of only LF.
Last edited on
I got it!
Thanks modoran.
Topic archived. No new replies allowed.