active wrote:
"John B" <jb******@yahoo.comwrote in message
<...>
>>>
It would be possible to create a generic control to do this but...
1) is a cast acceptable at run time from the loosely typed items
collection.
If I understand: That's what I want to get away from with the
Forms.ComboBox
I agree but you are limited in the fact that you need to add the items
to the base combo's collection so it displays them.
You could keep another collection (strong typed) and just return that as
the items property but you'd need to ensure it was readonly or you'd
have to be notified when items are added.
>2) not sure how much luck you'd have validating item addition so you might
have to roll your own combo, not a trivial task i'd imagine
You think if I did what you said below and added AddItem and AddItemRange
with typed arguments (and ignored the Item.Add and Item.AddRange) - sound
like it would work.
It would work yes, but it depends on how much validation you want.
You would have to determine whether you wanted to absolutely prevent
adding to the items collection (by casting to combobox) or just
accept/hope that it would not happen.
There is a SetItemCore and SetItemsCore method but it appears they only
get called when you set a datasource.
JB
<...>