Serialization

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to serialize a class that have a field of type System.Windows.Forms.Panel it give me an exception saying that "...System.Windows.Forms.Panel is no marked as Serializable...", how can I resolve this problem if I need to save the panel field...

Thanx in advantage;
 
In order to serialize a class, it should be marked serializable. You do this by adding the [Serializable] attribute just above the declaration of the class

HTH
fbhcah
 
Hi,

You could write a wrapper class for the Panel field that does do
serialization. Inside the wrapper class, do all logic to (de)serialize the
data of the panel. Keep the panel as a private field within the wrapper
class.

Erik

Hector Martinez said:
I need to serialize a class that have a field of type
System.Windows.Forms.Panel it give me an exception saying that
"...System.Windows.Forms.Panel is no marked as Serializable...", how can I
resolve this problem if I need to save the panel field...?
 
Back
Top