From: Landon on
I've ever seen an application that moves the active control using Tab or
Enter key.

So the application has a few Combo Boxes, CEdit, Checkboxes and to move from
one control to another, we can use either Tab or Enter key.

How to do that?

I've tried to find it but I still haven't found any.

Thank you very much.
From: robert on
You need to deal with WM_KEYDOWN message for Enter key.
Simply explains below:
1.In the recieving function for WM_KEYDOWN, catch the key 'Enter'.
2.Call GetNextDlgTabItem API to get the next control which is capable to tab
3.Call SetFocus on the control

Thanks
Robert

"Landon" <Landon(a)discussions.microsoft.com> д����Ϣ����:C701AC43-5F70-4847-ABC4-55D99F63A69C(a)microsoft.com...
> I've ever seen an application that moves the active control using Tab or
> Enter key.
>
> So the application has a few Combo Boxes, CEdit, Checkboxes and to move
> from
> one control to another, we can use either Tab or Enter key.
>
> How to do that?
>
> I've tried to find it but I still haven't found any.
>
> Thank you very much.


From: Landon on
> You need to deal with WM_KEYDOWN message for Enter key.
> Simply explains below:
> 1.In the recieving function for WM_KEYDOWN, catch the key 'Enter'.
> 2.Call GetNextDlgTabItem API to get the next control which is capable to tab
> 3.Call SetFocus on the control
>
> Thanks
> Robert

I've seen the source code and I have looked everywhere for Enter, Return,
WM_KEYDOWN keywords but I don't find any. I also confused how can it possible
to move focus without any codes.

What does the programmer use?

Thank you very much.
From: AliR (VC++ MVP) on
Look for

void CMyDialog::OnOK()
{
CWnd *pWnd = GetNextDlgTabItem(GetFocus());
if (pWnd)
{
pWnd->SetFocus();
}
}

AliR.




"Landon" <Landon(a)discussions.microsoft.com> wrote in message
news:C701AC43-5F70-4847-ABC4-55D99F63A69C(a)microsoft.com...
> I've ever seen an application that moves the active control using Tab or
> Enter key.
>
> So the application has a few Combo Boxes, CEdit, Checkboxes and to move
> from
> one control to another, we can use either Tab or Enter key.
>
> How to do that?
>
> I've tried to find it but I still haven't found any.
>
> Thank you very much.


From: Joseph M. Newcomer on
The only problem with this code is that it disables the OK key, and will only work under
circumstances where the <enter> key sends IDOK, which is not true of being in all
controls.

I'd suggest this is one of the few valid uses of PreTranslateMessage.
joe

On Tue, 13 May 2008 11:10:55 -0500, "AliR \(VC++ MVP\)" <AliR(a)online.nospam> wrote:

>Look for
>
>void CMyDialog::OnOK()
>{
> CWnd *pWnd = GetNextDlgTabItem(GetFocus());
> if (pWnd)
> {
> pWnd->SetFocus();
> }
>}
>
>AliR.
>
>
>
>
>"Landon" <Landon(a)discussions.microsoft.com> wrote in message
>news:C701AC43-5F70-4847-ABC4-55D99F63A69C(a)microsoft.com...
>> I've ever seen an application that moves the active control using Tab or
>> Enter key.
>>
>> So the application has a few Combo Boxes, CEdit, Checkboxes and to move
>> from
>> one control to another, we can use either Tab or Enter key.
>>
>> How to do that?
>>
>> I've tried to find it but I still haven't found any.
>>
>> Thank you very much.
>
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm