CListCtrl with CheckBox option in Report View
Posted on 2000-03-08
I have a list control with the checkbox option on. I wanted to set it up so no matter where on the row a user clicked the checkbox would work. I followed code on codeguru and on my click event I check if the click is inside of any of the rows (inside GetItemRect with LVIR_BOUNDS) and if it is I call SetCheck on that row. It all works except for if I try to click inside of the checkbox. Now it gets to the OnItemChangedList twice. ie - it automatically is checked as that is handled when you check and it also is handled a second time through my click code. Therefore it does a quick check/uncheck combo. I looked up how to calculate bounding rectanges on the list view so I could return from the click event if the user clicked in the checkbox and there is LVIR_BOUNDS, LVIR_ICON, and LVIR_LABEL. I didn't see anything for getting the rectangle of the checkbox. Anyone have any good ideas on this one.