Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Multiline Edit Control

Posted on 2006-11-06
1
Medium Priority
?
279 Views
Last Modified: 2010-04-01
Hi Experts,

I have a multiline edit control. When I load the dialog with the edit control, I want to

be able to initiliaze the text in the control so it will insert a line break where spaces occur

in the text. So SetDlgItemText(hWnd, IDC_EDIT, "This is a test"); should display in

the edit box as:

This
is
a
Test

I tried replacing the spaces with '\r' and '\n' characters to no effect.

How do I preformat a string so it will display on multiple lines in the edit control?

Thanks!

0
Comment
Question by:CPOsosky
1 Comment
 
LVL 86

Accepted Solution

by:
jkr earned 400 total points
ID: 17882899
>>How do I preformat a string so it will display on multiple lines in the edit control?

You need to use '\r\n', e.g.

SetDlgItemText(hWnd, IDC_EDIT, "This\r\nis\r\na\r\ntest");
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question