Click to See Complete Forum and Search --> : Edit Box and adding text


April 28th, 1999, 01:11 AM
I am trying to add text to a multiline edit box by using the SetWindowText method in MFC. The text has embedded '\n' so that the text will show up as multiline. Instead of going to a new line, the '\n' shows up as a solid pipe '|'. Is there a way to add multiline text to an edit box with a single method call? If not, what is the best way to do it? The text doesn't have to be editable, only scrollable.

Jason Teagle
April 28th, 1999, 02:50 AM
First, to clear up any possible slip-up, make sure the edit box has the multiline property set in the dialogue resource. Yes, I *know* you're not that stupid, but I have to cover all possibilities.

If that is OK, try using "\r\n" instead of just '\n'. Multiline text tends to recognise that character pair rather than just the single line feed - CDC::DrawText() expects this, for example.

Does this help?

July 9th, 1999, 02:23 AM
Thanx, helped me too...