Solved

Multiline Edit Control

Posted on 2006-11-06
1
267 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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PDF library for Delphi 2 121
VS2015 compilation and missing DLLs 9 147
How to convert MFC APP to Win32 APP. 19 79
Installshield for Embarcadero EX 10.1 Berlin 4 40
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

770 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