.net - Check/DeCheck all items in Check-list box vb.net -



.net - Check/DeCheck all items in Check-list box vb.net -

a couple of questions check list boxes:

how check/decheck item in list

how re-create or delete checked items in list

while can scan checkeditems , checkedindices properties, cannot modify them @ same time. create re-create of collection , process re-create instead.

uncheck checked items:

dim checkedindices(checkedlistbox1.checkeditems.count - 1) integer checkedlistbox1.checkedindices.copyto(checkedindices, 0) each index integer in checkedindices checkedlistbox1.setitemchecked(index, false) next

delete checked items:

dim checkeditems(checkedlistbox1.checkeditems.count - 1) object checkedlistbox1.checkeditems.copyto(checkeditems, 0) each checkeditem object in checkeditems ' alternateively, add together code re-create checkeditem here. checkedlistbox1.items.remove(checkeditem) next

edit: changed array declarations (.count - 1). vb's declaration syntax in infuriating sometimes.

.net windows vb.net copy

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -