Hi all,
I'm trying to write my own FlatComboBox control. One of its properties is an
Items collection. An Item consists of a text, key and imageindex property.
When adding items to a FlatComboBox (during design time) and filling in
text, key and imageindex properties all seems to work, but when I start the
application, the Items are all gone.
My guess is that I need to make the Item class serializable (so it can be
saved), which I did, but when I go to the form designer window, the form
won't show up anymore. I get the build error: "At least one element in the
source array could not be cast down to the destination array type."
The only thing added in the form's code is:
Me.FlatComboBox1.Items.AddRange(New FlatComboBox.Item()
{CType(resources.GetObject("FlatComboBox1.Items.It ems"), FlatComboBox.Item),
CType(resources.GetObject("FlatComboBox1.Items.Ite ms1"), FlatComboBox.Item),
CType(resources.GetObject("FlatComboBox1.Items.Ite ms2"),
FlatComboBox.Item)})
I do not see the text, key or imageindex properties in the new items. Btw, I
don't have the problem when I make the Item class inherit the Component
class, but then all items I add to the FlatComboBox show up in the form's
designer window.
What is happening here and what's the solution to it? Thanks in advance.
Stefan.