Solved

Multiline Edit Control

Posted on 2006-11-06
1
264 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 100 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 Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now