Solved

CEdit and the return key

Posted on 1998-08-24
5
543 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 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Vb.Net Loading Word 11 107
Messagebox for a Web Site Application 4 82
String manipulation in Visual Basic 7 84
Shared files and folders migration 2 30
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.  …
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

726 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