Hello guys,
I have question on serialization.
I have made a form object and added some controls in it dynamically.
So, I want to save that form along with the controls in it.
That's why I decided to serialize the form object.
But when I call serialize the form object, an exception occurred.
BinaryFormatter objBinaryFormatter = new BinaryFormatter();
FileStream objFileStream = new FileStream(strCompleteFilePath, FileMode.OpenOrCreate);
objBinaryFormatter.Serialize(objFileStream, formObject);
Type 'System.Windows.Forms.Form' in Assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.
Can anybody help me in this.
Cant we serialize a form object.
If we can, then please suggest some answers.
Thanks in advnace