I have created a MFC Document View app and added several classes which inherit from CEdit to the CView. I would like to get tabbing between each CEdit working. I have looked around and most solution involve Adding IsDialogMessage() to either the message loop or in PreTranslateMessage. I have tried this in the PreTranslateMessage method of the CEdit class like this:
BOOL WordControl::PreTranslateMessage(MSG* pMsg)
{
if(IsDialogMessage(pMsg))
return TRUE;
else
return __super::PreTranslateMessage(pMsg);
}
however, now the CEdit doesn't receive any keyboard messages and doesn't tab. I have created the CEdit like this:
Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER | ES_CENTER , Rect, Parent, Index);
What am I doing wrong?
EDIT:
The app uses the basic MFC single document
template. I am dynamically adding several objects which inherit from CEdit and several which inherit from CStatic. I have managed to create all the CEdits and CStatics but I would like to be able to tab from CEdit to CEdit.
A picture is worth a thousand words; here is a screenshot:

I want to be able to type "hello" in the first CEdit, hit tab and for the next CEdit to have focus. Then I will type "world" and then hit tab and the next CEdit will have focus for me to type "this" etc.
EDIT:
New Window:

CEditViewinstead? - Shane HawCEditViewas per your suggestion but the app gave a Debug Exception failure on startup. - Shane Haw