Connecting Tech Pros Worldwide Help | Site Map

Disabling Manual Checking/Unchecking of CheckedListBox Items

Phil Galey
Guest
 
Posts: n/a
#1: Jul 21 '05
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


Charles Law
Guest
 
Posts: n/a
#2: Jul 21 '05

re: Disabling Manual Checking/Unchecking of CheckedListBox Items


Hi Phil

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

HTH

Charles


"Phil Galey" <pagaley@starcalif.com.nospam> wrote in message
news:uxolFPPSEHA.1764@TK2MSFTNGP10.phx.gbl...[color=blue]
> 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 =[/color]
True,[color=blue]
> the user is still able to both select and check items. The Locked[/color]
property[color=blue]
> 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[/color]
of[color=blue]
> 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
>
>[/color]


Closed Thread