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
Solved

CEdit and the return key

Posted on 1998-08-24
5
542 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
  • 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 120 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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