Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 617
  • Last Modified:

Processing Tab in CEdit control

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
sun307
Asked:
sun307
1 Solution
 
inprasCommented:
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
 
timopCommented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now