Disabling Manual Checking/Unchecking of CheckedListBox Items

P

Phil Galey

In VB.NET, is there a way to make it so the user can select items in a
CheckedListBox, but is NOT able to check them? Even if I set Locked = True,
the user is still able to both select and check items. The Locked property
appears to be a dummy switch.

Setting the CheckOnClick property to False gets me half way home, as it
requires the user to click a second time in order to toggle the checkbox of
the selected item; however, I need to completely disallow the user from
manually changing the state of the item checkboxes ... it's to be done
programmatically only.

Is this possible with the CheckedListBox control in VB.NET? Thanks.

Phil
 
C

Charles Law

Hi Phil

Add code to the BeforeCheck event, and set e.Cancel = True.

HTH

Charles
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top