Search

CMFCDropDownListBox::OnDrawItem should use DT_NOPREFIX by Neil Adams

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 619673
Opened: 11/6/2010 7:42:13 AM
Access Restriction: Public
2
Workaround(s)
0
User(s) can reproduce this bug
CMFCDropDownListBox::OnDrawItem should use DT_NOPREFIX to correctly display strings that use the '&' character. This would also be consistent with CMFCRibbonComboBox. I can't escape the '&' using another one, as CMFCRibbonComboBox does use DT_NOPREFIX and so I end up with a double '&&' in the combo.
Details (expand)

Visual Studio/Silverlight/Tooling version

Visual Studio 2010

What category (if any) best represents this feedback?

 

Steps to reproduce

Add a CMFCRibbonComboBox to a ribbon.
Add some strings to it that contain the '&' character.
Drop down the combo list.

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

The strings containing '&' are shown in the dropdown with an underscore at the position of the '&'.

Expected results

The '&' character should be displayed.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 11/19/2010 at 5:06 PM
Hello,

Thanks for the report. This issue has been fixed in MFC for a future release of Visual Studio.

Pat Brenner
Visual C++ Libraries Development
Posted by Microsoft on 11/6/2010 at 8:23 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by Neil Adams on 11/6/2010 at 7:44 AM
Don't use the '&' character in your ribbon combobox items!
Posted by Neil Adams on 11/6/2010 at 7:43 AM
I think deriving from CMFCRibbonComboBox and overriding CMFCRibbonComboBox::OnDrawDropListItem to draw the text as required would get around this.