Solved

How to display multiple lines in a edit box at runtime?

Posted on 2001-07-11
2
226 Views
Last Modified: 2013-11-20
Hello everyone,

  I want to display multiple lines in a edit box at run time.

  What I did was as follows:
   szNewLine.Format("%s\n%s", szPrevLine, szLine);
   pEdit->SetWindowText(szNewLine);
  Instead of seeing two lines inside the edit box as I expected, I saw one line with a CR separating two strings. How can I implement multiple lines at run time as if the user hits enter within a multiple-lined edit box?

  Thanks.

Nancy



0
Comment
Question by:qwang73
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
Comment Utility
You'll have to make sure that the edit field has the 'ES_MULTILINE' style set (you can check/set that in the resource editor). Furthermore, you'll have to use the correct linebreak:

  szNewLine.Format("%s\r\n%s", szPrevLine, szLine);
  pEdit->SetWindowText(szNewLine);

'\r\n' is what you'll need.


0
 

Author Comment

by:qwang73
Comment Utility
jkr,

  Thanks for your answer and the note about duplicate question. '\r\n' is exactly what I need. Funny thing is that I tried to put 0x0A(LF) and 0x0D(CR) at the end and it didn't work. Is that the same as '\r\n'?

Nancy
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

13 Experts available now in Live!

Get 1:1 Help Now