Tabbing in MDI Child Windows 
Author Message
 Tabbing in MDI Child Windows

Hi there

I am writing an application that uses mdi child windows as data entry
forms - that is to say each of my data entry windows are derived from
CMDIChildWnd.
I want to be able to catch the enter and tab presses so that i can
move the focus to the next window in my group.

I can see two ways to do this:
1.) subclass CEdit, CComboBox, CDateTimeCtrl and catch the WM_KEYDOWN
messages.  I am trying this at the moment:
void CMjlEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
GetParent()->SendMessage(MY_MSG_ENTERPRESSED, 0, (LPARAM)this);
CEdit::OnKeyDown(nChar, nRepCnt, nFlags);

Quote:
}

2.) implement an accelerator somehow so that the tab key has a message
generated.  when i coded a similar problem in win32 c, that is how i
did it.

What is the best way to do what i want?  Is there another way?

Thanks

Matthew Luckie



Fri, 26 Jul 2002 03:00:00 GMT  
 Tabbing in MDI Child Windows
I believe it is already default behavior to switch between MDI child windows
when the user presses Ctrl-Tab.  Is this not good enough?


Fri, 26 Jul 2002 03:00:00 GMT  
 Tabbing in MDI Child Windows

Quote:
>I am writing an application that uses mdi child windows as data entry
>forms - that is to say each of my data entry windows are derived from
>CMDIChildWnd.
>I want to be able to catch the enter and tab presses so that i can
>move the focus to the next window in my group.

Matthew,

Do you want to switch between the different MDI child windows on
Tab/Enter, or just do the normal dialog operation of moving to the
next control in the same MDI child window?

If you want to stay in the same child window, then can't you make use
of CFormView, or use IsDialogMessage (which is what does the normal
Tab operations for dialogs)?

If that doesn't fit, probably the best catch-all place is in your MDI
child window's PreTranslateMessage - you should be able to catch the
WM_KEYDOWN messages there and switch the child window activation
without having to sub-class each control window.

Dave
--
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Sat, 27 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. MFC MDI Multiple Views in Separate MDI Child Windows

2. Opening a new MDI child when no MDI Child exists

3. Opening a new MDI child from a MDI Child

4. How develop MDI application with child forms like VB MDI and Child forms

5. MDI Children Within a Tab Control

6. MDI app, but all children maximised with a tab control to select

7. TAB key, controls and child windows with controls

8. Changing tab order of dynamically created child windows

9. Tab Controls and MDI windows

10. mdi child windows close

11. Creating Borderless Child Windows in an MDI application

12. getting all open MDI child windows from CMainFrame

 

 
Powered by phpBB® Forum Software