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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CString Newline Escape Sequence Character not working 1

Status
Not open for further replies.

rchandr3

Programmer
Jun 16, 2003
244
US
May be an easy question for most of you!

I have a CString variable when I allocate a "\n" Newline to it, it doesnt take care of it. while the "\t" works.

Code: CString strMessage;
strMessage = _T("I am a Tek-Tips Member. \n\t I would be thanksful to people giving me solution");

I tried Format() method of CString and its also not working out for me.

Thanks in Advance


Cheers,

Ravi
 
What are you placing the text in? If it is a text control, you must make it multi-line. If you are writing it to a file, some programs may display it incorrectly.

If it is neither of these, post again and let us know where you are placing the text.

Matt
 
Thanks Matt,

I want to post the text in a Edit Control in a dialog box. I have already made that multiline. I have given a Vertical Scrollbar too...

But I dont get the \n working.

Please help me further...

Cheers,

Ravi
 
Do you have a member variable set to the edit control? Are you calling update data?

Matt
 
I have a member variable set. I am calling the dialog in a different dialog.

I am getting the string displayed in the edit, but not with multiline formatting. It gets multiline only at the line end and ignores my /n characters.

Thanks again...

Cheers,

Ravi
 
Waaaw!

It worked! Thanks a lot uolj!!!



Cheers,

Ravi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top