I think it make sense to first set the iconstrip to the listbox before assigning an icon number to the gadgetitem.
I got the same error as you described as well if I assign the icons flag before setting the iconstrip to the listbox.
I got the same error as you described as well if I assign the icons flag before setting the iconstrip to the listbox.