Solved

CEdit and the return key

Posted on 1998-08-24
5
531 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
Comment Utility
Edited text of question
0
 

Author Comment

by:vinny5
Comment Utility
Edited text of question
0
 
LVL 22

Expert Comment

by:nietod
Comment Utility
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
Comment Utility
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
Comment Utility
I gave it a try and it works..thanks
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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
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.

772 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

9 Experts available now in Live!

Get 1:1 Help Now