?
Solved

CEdit and the return key

Posted on 1998-08-24
5
Medium Priority
?
558 Views
Last Modified: 2013-12-03
I have a dialog derived from cformview.

On the dialog I have a single line edit control that I treat as a command line. What I need to do is recognize when when the user finshes typing command and its arguments. What I would normally do is check is '\n' is at the end of
the CString associated with the edit box.  Problem is the '\n' gets stripped unless I use a multi-line edit box.

I really want a single line edit box.


void CView::OnUpdateEditCommandline()
{
       UpdateData(TRUE);  
      if (m_CommandLine.Right(1) =='\n')
                  {
            m_CommandLine is complete start parsing the command line
                  }
}

this only works if I resize my edit box from 1 line to 2 lines.

Any work around for this?

the styles on the Editbox are: Multiline,Auto Hscroll, Want Return
0
Comment
Question by:vinny5
[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
  • 3
5 Comments
 

Author Comment

by:vinny5
ID: 1413873
Edited text of question
0
 

Author Comment

by:vinny5
ID: 1413874
Edited text of question
0
 
LVL 22

Expert Comment

by:nietod
ID: 1413875
Why not put a default button (okay) on the dialog?  When you press return, it is the same as pressing the default button.
0
 
LVL 1

Accepted Solution

by:
rlarner earned 480 total points
ID: 1413876
Try disabling BOTH Multiline and Want Return.  Then, when the user hits 'return' the default button on your dialog should be pressed.
0
 

Author Comment

by:vinny5
ID: 1413877
I gave it a try and it works..thanks
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

800 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