Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Processing Tab in CEdit control

Posted on 2000-02-14
Medium Priority
Last Modified: 2008-02-01
Hi !
I want to process tab key in a CEdit control i.e. whenever user presses Tab key, instead of moving out of control, the cursor should move in a CEdit control.
Question by:sun307
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

Expert Comment

ID: 2521724
Derive UR own class from CEdit let it be CMyEdit map Onchar to CMyEdit
UR control should be of type CMyEdit
then in function
   if (nCahr == VK_TAB)
     //Move in a Edit Control by using SetFocus();

Hope this helps

Accepted Solution

timop earned 100 total points
ID: 2540551

To process TAB key in the CEdit control you have to override OnGetDlgCode ( message handler for WM_GETDLGCODE ).
Now, CMyEdit::OnChar will be called when TAB is pressed.

UINT CMyEdit::OnGetDlgCode()
      return CEdit::OnGetDlgCode() | DLGC_WANTTAB;


Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

705 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