• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

addint text to a cedit

I have a multi-line edit control, and I want to add a few lines of text to it.

I've done this:

CString sLine;
sLine = "first line\nsecond";

m_LICIENCE_EDIT.SetWindowText(sLine);


And get this result:
"first line|second"

This is all on one line.  How can I change this?

Thanks,

TimB
0
TimB
Asked:
TimB
  • 5
  • 3
1 Solution
 
lif081199Commented:
use \r\n and not only \n

CString sLine;
sLine = "first line\r\nsecond";
m_LICIENCE_EDIT.SetWindowText(sLine);

Good luck,
Lionel.
0
 
V_BapatCommented:
Change this line:
sLine = "first line\nsecond";

To:
sLine = "first line \r\nsecond";

Vicky
0
 
lif081199Commented:
And, of course, don't forget to check the "multiline" property in your resource editor
(Sorry if this comment hurts you ;))
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
lif081199Commented:
Hello V_Bapat, have you read my answer ?
0
 
TimBAuthor Commented:
Thanks lif,  that worked.

Submit as an answer if you'd like some points.

TimB
0
 
lif081199Commented:
I can no more submit it as an answer,
because the question is locked :(
0
 
TimBAuthor Commented:
sorry V_Bapat, lif got there first.

TimB
0
 
lif081199Commented:
Thank you
0
 
TimBAuthor Commented:
Thanks!
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now