Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi-line in CEdit

Status
Not open for further replies.

qzou666

Programmer
Feb 12, 2002
11
0
0
NZ
Hi,

I want to place a mutli-line CString on a CEdit, but the line break "\n" does not break line. "\n" displayed as a symbol like "[]". Please help me out here. The following is the code:

Ctring test="";

for (int i=0; i<20; i++)
{ CString line=&quot;New line\n&quot;
test+=line;
}

CEdit* pEdit;
....//get the edit
pEdit->SetWindowText(test);


The text on CEdit is something like:

New line[]New line[]New Line[] ...........


Cheers
 
are you sure your CEdit has style ES_MULTILINE?

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
You also want to use the combined characters &quot;\r\n&quot; for a line break.

-pete
 
Yes, I did set the ES_MULTILINE. And &quot;\r\n&quot; did not work either.

Thank you very much
 
Works for me everytime. Never seen it fail.

-pete
 
&quot;\r\n&quot; worked now, thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top