A
active
I'm using a ComboBox to display objects of a class I've defined, say CQQ.
Works great except somehow I occasionally set an Item to a String object
instead of an object of type CQQ.
It looks like Text replaces an item or something like that.
This results in a runtime error at which time I learn that the item that
should be CQQ is a String.
I can't find out where or how the setting happens.
It occurs to me that if the comboBox defined it's Items as objects of type
CQQ instead of Object it would the usage would be less error prone and more
likely to be bug free.
Is there some way I could generate a strongly typed combobox?
I know I could simply inherit a combobox and try to override anything the
changes an Item but that leaves the possibility that I'd miss some method
and not really have what I want. I'd like to just change the Items
collection once.
Is that possible?
Thanks
Works great except somehow I occasionally set an Item to a String object
instead of an object of type CQQ.
It looks like Text replaces an item or something like that.
This results in a runtime error at which time I learn that the item that
should be CQQ is a String.
I can't find out where or how the setting happens.
It occurs to me that if the comboBox defined it's Items as objects of type
CQQ instead of Object it would the usage would be less error prone and more
likely to be bug free.
Is there some way I could generate a strongly typed combobox?
I know I could simply inherit a combobox and try to override anything the
changes an Item but that leaves the possibility that I'd miss some method
and not really have what I want. I'd like to just change the Items
collection once.
Is that possible?
Thanks