WxListBook

From WxWiki

Jump to: navigation, search

[edit] Gotchas

[edit] Deleting some selected rows correctly

"Rows" in a listctrl are called 'items' and are indexed starting from zero. You often want to delete some items that the user has selected. This is obviously done is get the index of the selected items, and then loop through, deleting the selected items. However, what will happen is that you will delete the first one, and the index numbers have now renumbered.

To get around this, you just need to loop through in reverse order: delete the bottommost selected item first, and work your way up.

Personal tools