Hei,
Is this a VB.NET question or a VB6 question? as you posted to both groups.
The solution you receive for VB6 will not work in VB.NET and visa versa.
How do you want it to behave. Once an item is checked you cannot check a
second one? Or the last item checked is the only item checked?
Why are you even bothering with a CheckListBox if you only one item can be
selected? A normal ListBox supports selecting a single item, so I would
STRONGLY recommend a normal ListBox or even a ComboBox to save screen space.
Also if I only had a handful of items, I would consider, as Cor suggested,
using Radio Buttons.
If I had a real need for a CheckListBox, I would handle the ItemCheck event.
In VB.NET The ItemCheck event itself allows you to control whether the item
should be checked or not. Seeing as VB.NET fully supports customizing
controls via inheritance I would create a new class derived from
CheckListBox that would encapsulate the currently checked item and handle
the ItemCheck within itself to ensure that only one item was ever checked...
Hope this helps
Jay
"Hei" <ch******@msn.com> wrote in message
news:uQ*************@TK2MSFTNGP09.phx.gbl...
Hi,
any ideas how to constrain the numbers of item can check in CheckListBox.
i would force user can only check one item.
thx
William