المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Tab key doesn't work right



C++ Programming
09-30-2010, 11:53 AM
Using Visual C++ 6, service pack 6 on XP. I have a set of COlePropertyPages controlled by an OCX embedded in a dialog box. On one property page I have 10 edit controls. I want the user to be able to jump from control to control using the Tab button. However, when the focus is in a control and the user hits the tab button, the focus jumps to the OK button in the dialog box. From that point on, repeatedly pressing the Tab button merely jumps between the Help, OK, and Cancel buttons on the dialog box.

Trapping the WM_KEYDOWN message in the property page doesn't help, the code isn't reached. I tried subclassing one of the edit controls. Even when that edit control has the focus, and the Tab button is pressed, the WM_KEYDOWN message isn't reached. I tried using PreTranslateMessage() in the subclass, the code isn't reached (I tested all these using a break point.)

How can I make it so that the Tab button jumps from edit control to edit control?

Thanks!