Click here to Skip to main content
15,559,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am creating ownerdraw component based on TCustomListView. All graphic work I do in the CustomDrawItem method.
I have problems with checkbox. To draw it I use this code:
C++
if(Item->Checked){
iStateId = CBS_CHECKEDNORMAL;
}
else{
iStateId = CBS_UNCHECKEDNORMAL;
}

DrawThemeBackground(hTheme, Canvas->Handle, BP_CHECKBOX, iStateId, &chk_box, NULL);

But when I click on the checkbox - its state does not change. However "Checkboxes" property is enabled.
So how to capture mouse click of checkbox to change its state?
Posted
Updated 3-Jan-21 10:34am

1 solution

Try updating the ListView after DrawThemeBackground()...IE ListView1->Update(); or maybe even ListView1->Invalidate();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900