solomon021499
asked on
Message Processing
This should be easy.
I have an MDI MFC application. The view is a CFormView
with Buttons, EntryFields, and ComboBoxes. The default
behavior is to go to the next control in the tab order
when the Tab key is hit. I want the same behavior when
Enter (or Return) key is hit.
This is not a CDialog it is a CFormView.
I have tried registering all sorts of message
handlers that should work, but none of them
get executed (OnChar, OnKeyDown, OnSysKeyDown,
OnNotify...).
Help!
I have an MDI MFC application. The view is a CFormView
with Buttons, EntryFields, and ComboBoxes. The default
behavior is to go to the next control in the tab order
when the Tab key is hit. I want the same behavior when
Enter (or Return) key is hit.
This is not a CDialog it is a CFormView.
I have tried registering all sorts of message
handlers that should work, but none of them
get executed (OnChar, OnKeyDown, OnSysKeyDown,
OnNotify...).
Help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
prasanth's proposed answer is the way to go.
Unfortunately, snoegler's comment will work for CDialogs, but not CViews.
Thanks
Unfortunately, snoegler's comment will work for CDialogs, but not CViews.
Thanks
Please don't think that this is against you - but it does work.
We've been using this in a project, and it worked :)
We've been using this in a project, and it worked :)
It may be invisible - so it won't affect your layout. Then add a handler:
void CMyFormView::OnOK()
{
int curID=GetDlgCtrlID(GetFocu
if( // check if curID is one of your edit fields //)
SetFocus( GetNextDlgTabItem(GetFocus
}