Archived

This topic is now archived and is closed to further replies.

Shag

Subclassing edit control problems ...

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites