Solved

Processing Tab in CEdit control

Posted on 2000-02-14
2
608 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

861 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