Search

CCheckListBox incorrectly displays BST_INDETERMINATE check state by Matt Lindner

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 641001
Opened: 2/2/2011 11:38:27 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
I am using a CCheckListBox in order to get a list box with check boxes in it. I have set the check style to use BS_AUTO3STATE in order to use the BST_INDETERMINATE check state.

There is a bug in CCheckListBox::PreDrawItemThemed that causes the check box to be drawn incorrectly when this state is active. The checkbox ends up being drawn as if it was unchecked and disabled.

The function uses the following code to convert the check to the draw state.

            int nState = CBS_UNCHECKEDNORMAL;
            switch (nCheck)
            {
            case 1 :
                nState = CBS_CHECKEDNORMAL;
                break;
            case 2 :
                nState = CBS_UNCHECKEDDISABLED;
            }

case 2 : is used for BST_INDETERMINATE. However, nState should be set to CBS_MIXEDNORMAL to correctly draw the checkbox.
Details (expand)

Visual Studio/Silverlight/Tooling version

Visual Studio 2010

What category (if any) best represents this feedback?

 

Steps to reproduce

Create a CCheckListBox with the BS_AUTO3STATE or BS_3STATE style. Set the check for one of the items in the CCheckListBox to BST_INDETERMINATE. Draw the CCheckListBox.

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

Check box is drawn as unchecked and disabled.

Expected results

Check box should be drawn as an enabled mixed check
File Attachments
File Name Submitted By Submitted On File Size  
TriStateCheckListDemo.zip 2/4/2011 18.64 MB
Sign in to post a comment.
Posted by Matt Lindner on 2/8/2011 at 10:06 AM
Thanks for the update.

When you say "major release," do you mean the upcoming service pack for VS 2010 or the release after that (presumably VS 2012)?

Matt
Posted by Microsoft on 2/8/2011 at 9:53 AM
Hello Matt,

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

Pat Brenner
Visual C++ Libraries Development
Posted by Microsoft on 2/6/2011 at 10:16 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Posted by Matt Lindner on 2/4/2011 at 2:30 PM
I uploaded TriStateCheckListDemo.zip. This project will produce a dialog application containing a CCheckListBox as well as some individual check boxes. The CCheckListBox and the check boxes all has the BS_AUTO3STATE style. Both the CCheckListBox and the check boxes each have an example of each of the three checked states: BST_UNCHECKED, BST_CHECKED and BST_INDETERMINATE. The check box with BST_INDETERMINATE is displayed incorrectly in the CCheckListBox.
Posted by Microsoft on 2/2/2011 at 6:44 PM
Thanks for reporting this issue. Please give us a demo project to demonstrate this issue so that we can conduct further research.

Thanks again for your efforts and we look forward to hearing from you.

Microsoft Visual Studio Connect Support Team

Posted by Microsoft on 2/2/2011 at 11:59 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.