?
Solved

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

Posted on 2001-07-11
2
Medium Priority
?
233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 6275223
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
ID: 6275331
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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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. …
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.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month8 days, 2 hours left to enroll

765 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