Solved

Processing Tab in CEdit control

Posted on 2000-02-14
2
607 Views
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.
-Regards
Sun307
0
Comment
Question by:sun307
2 Comments
 
LVL 4

Expert Comment

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

Hope this helps
0
 
LVL 1

Accepted Solution

by:
timop earned 50 total points
ID: 2540551
Hi,

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;
}



0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

832 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