So I'm working on this CheckListBox and would like to override the Add() method which adds a new item to the checklistbox, but, the method is not a CheckListBox method, it's a method in the CheckListBox's ObjectCollection.
So, two questions:
- Can this method be overriden from within a control that inherits directly from CheckListBox?
- Is it possible to completely override the collection the CheckListBox accepts so that I can handle the adding and removing from the list directly. As in, instead of my custom control using CheckListBox.ObjectCollection for items, can it use MyCheckListBox.MyCustomCollection class that inherits from ObjectCollection? If so, I'm not sure how to change that in the control.
I would really appreciate any suggestions on this. I am attempting to add values to the items that depend on the state of the item's check value, and instead of maintaining multiple dictionaries/lists, it would be nice to just use one, each item stands alone with each value stored in its respective class object MyCustomItem or something that would go in the MyCustomCollection.
Any ideas?