Subclassing edit control problems ...

Started by
3 comments, last by Shag 21 years, 5 months ago
OK ... I''ve subclassed an edit control to intercept the tab key (to move the focus to another edit control). This works fine apart from one small problem - everytime I hit the tab key the program beeps at me Any ideas what''s going on? Regards
Advertisement
Anoter question ...

Do you actually have to subclass to enable the tab key to move the focus from one edit control to another? This implies otherwise ...

QUOTE - MSDN: The user can select an edit control by clicking it with the mouse or by tabbing to it. The "tabbing" method is part of a predefined keyboard interface that the system provides.

Is this crap? I believe that only works when using dialog resources. Can someone confirm that?

Cheers
quote:Original post by Shag
Do you actually have to subclass to enable the tab key to move the focus from one edit control to another? This implies otherwise ...

i would expect that kind of functionality to be available through PreTranslateMessage or its equivalent.

no ideas on your original question, but moving from subclassing to PreTranslateMessage may fix it.
you don''t need to subclass to get tab key support. it sounds like you''re creating your control window on the fly, not through a dialog resource? if so, are you setting the WS_TABSTOP style?
quote:Original post by niyaw
i would expect that kind of functionality to be available through PreTranslateMessage or its equivalent.

no ideas on your original question, but moving from subclassing to PreTranslateMessage may fix it.


PreTranslateMessage is MFC-specific and has nothing to do with tab key processing.

tab key processing is handled via the normal dialog box message pump or via explicit IsDialogMessage call.

This topic is closed to new replies.

Advertisement