.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

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -