Solved

Processing Tab in CEdit control

Posted on 2000-02-14
2
602 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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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.
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.

743 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

16 Experts available now in Live!

Get 1:1 Help Now