[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

How to edit text on Editbox of Dialog (MFC application)

Posted on 2010-03-28
2
Medium Priority
?
858 Views
Last Modified: 2013-11-20
I have a Dialog, and a Text box (multi line) on dialog
I want to editable this textbox

But If I press Enter, the Dialog disapeare!
I repaire source with this guide, and It work with Enter key
http://www.codeguru.com/Cpp/controls/editctrl/article.php/c483

But now, I want to edit textbox, EnterKey <=> new line ... (like Notepad)

How can I do this?
Thank you!
0
Comment
Question by:bxglxbxglx2000
2 Comments
 
LVL 45

Accepted Solution

by:
AndyAinscow earned 600 total points
ID: 28868072
Resource editor - properties of the edit box.  Set Multiine to true and also Want Return to true.  That should do it.
0
 
LVL 33

Assisted Solution

by:pgnatyuk
pgnatyuk earned 400 total points
ID: 28869117
I read the article you posted.
AndyAinscow has said how this Enter task should be fixed correctly.

If we go back to this article, pay attention that there is no default button in his dialog - when you press Enter, actually, you press on this default button. In your case, it is Ok or Cancel and so, when you press Enter, you close the dialog.
Also if you changed PreTranslateMessage as it is shown in the article, you need to check that you don't have a mistake with GetClassName stuff. When you debug your app, set a breakpoint on the line with return TRUE from this function and check if you get there.

But really, this article gives a bad advice.

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
There may be issues when you are trying to access Outlook or send & receive emails or due to Outlook crash which leads to corrupt or damaged PST file. To eliminate the corruption from your PST file, you need to repair the corrupt Outlook PST file. U…
Suggested Courses

591 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