473,385 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Do I have to serialize?

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.
Jul 19 '05 #1
0 1007

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: David Sworder | last post by:
Hi, I've created a UserControl-derived class called MyUserControl that is able to persist and subsequently reload its state. It exposes two methods as follows: public void Serialize(Stream...
3
by: Kristian Kjems | last post by:
This is the example from MSDN where an object is serialized to a filestream: MySerializableClass myObject = new MySerializableClass(); // Insert code to set properties and fields of the object....
7
by: grwalker | last post by:
I have some classes that have the <Serializable()> attribute applied, which of course by default serializes the class properties as elements. What I would like to do is to be able to override this...
10
by: Dan | last post by:
All I Am Attempting To Serialize An Object To An XML File. Here Is The Code For That public string SaveNewSurvey( MutualSurveyObject mso_TempObject, int i_JobID ) { string s_RootFileName;...
10
by: Rafi B. | last post by:
I'm running this on a Linux/CentOs/cPanel server, trying to add caching to my PHP5 code, using ADOdb. I have two Linux servers, one of them is running perfect, the second one, just crashes without...
1
by: js | last post by:
Does anybody knows how to solve the problem? I added attribute to the following classes in Microsoft.Practices.EnterpriseLibrary.Data namespace, but I still get the error. Thanks. ...
1
by: Tim | last post by:
Could anyone tell me what this means and how do I correct it. Any suggestions? Thanks! Tim Richardson IT Developer and Consultant www.paladin3d.com Unable to serialize the session state. In...
18
by: yusuf | last post by:
I basically want to be able to store and retrieve a tree structure in greasemonkey. Unfortunately the GM_setValue and GM_getValue functions only take string key value pairs. Is there a native...
1
by: job | last post by:
how is it possible to serialize/de-serialize a SqlCommand?
1
by: Danny | last post by:
Am trying to XML serialize a BuildEventArgs (used for msbuild stuff) object but I don't get any xml outputted! just a header.The docs say I should be able to serialize the class public abstract...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.