BUG: Size of Owner-Draw Drop-Down Combo Box in Dialog Is Wrong

Last reviewed: January 5, 1995
Article ID: Q111096
The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) for Windows version 3.1

SYMPTOMS

When creating an owner-draw drop-down combo box in a dialog box, the size of the static portion is not the same as a non-owner-draw combo box in the same dialog box. WM_MEASUREITEM is not being processed, and therefore the size of the owner-draw combo box and non-owner-draw combo box should be the same.

CAUSE

When creating a dialog box, the Dialog Manager determines how big the owner- draw combo box should be based on the system font. If you specify a font in your dialog box resource, this font should be used rather than the system font in determining the size of the controls. Unfortunately, the Dialog Manager uses the system font when determining the size of the static portion of an owner-draw combo box, regardless of whether a different font has been specified in the dialog box resource.

RESOLUTION

To circumvent this problem, process the WM_MEASUREITEM message, specifying the height of the items in your combo box. Windows correctly sizes the static portion when you handle the WM_MEASUREITEM message.

STATUS

Microsoft has confirmed this to be a bug in Windows version 3.1. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional reference words: buglist3.10 3.10 combobox ownerdraw dropdown
KBCategory: kbprg kbbuglist
KBSubcategory: UsrCtl


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 5, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.