FIX: Combo Box in Toolbar Leaves Drop-Down Portion BehindLast reviewed: September 18, 1997Article ID: Q113587 |
1.00
WINDOWS
kbprg kbfixlist kbbuglist
The information in this article applies to:
SYMPTOMSIn an MDI application, with a toolbar that contains a combo box, if the mainframe is moved while the drop-down portion of the combo box is showing, the frame moves but the drop-down box remains in its original position on the screen. The combo box must have either the CBS_DROPDOWN or CBS_DROPDOWNLIST style in order for this to occur.
RESOLUTIONThe problem occurs because the CMDIFrameWnd::PreTranslateMessage member function does not call its base class version of PreTranslateMessage. CFrameWnd is the base class of CMDIFrameWnd. CFrameWnd::PreTranslateMessage calls the _AfxCancelModes function, which determines whether the drop-down portion of a combo box is showing and closes it if it is. CMDIFrameWnd::PreTranslateMessage does not call _AfxCancelModes, and therefore the drop-down portion is never closed. To workaround this problem, the application should override PreTranslateMessage in the mainframe class. The override should check for either the WM_LBUTTONDOWN or WM_NCLBUTTONDOWN message and call _AfxCancelModes. The override should then call the base class version of PreTranslateMessage, CMDIFrameWnd::PreTranslateMessage. Perform the following five steps to accomplish this:
Microsoft has confirmed this to be a problem in the Microsoft Foundation classes (MFC) version 2.0. This problem was corrected in the Microsoft Foundation classes version 2.5.
|
Additional reference words: 1.00 2.00 combobox painting dropdown
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |