ChekedListBox check only if mouse is over checkbox
-
Hi everyone! I would like the checkedlistbox control to change the checked state of an item only if I click on the checkbox. Is there a (not too difficult) way to do that? Thanks in advance! Istvan
The only thing I can think of is to set the
SelectionMode
to None. Now, in the mouse click event, get the location of click. If it is on the checkbox, programmatically check the item.The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures." जय हिंद
-
The only thing I can think of is to set the
SelectionMode
to None. Now, in the mouse click event, get the location of click. If it is on the checkbox, programmatically check the item.The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures." जय हिंद
You have to use HitTestInfo function to check current mouse position and then automatically check or uncheck the box. Sorry, this method doesn't works with CheckedListBox control.