关于序列化的问题:
冷锋 2003-05-09 10:22:58 自做的一个控件继承自Control,我在控件的前面加上了<Serializable()>,可是我在对该控件的实例进行序列化时系统出现Windows.form.control未被标记为可序列化,不知道是什么原因?
<Serializable()> Public Class MyControl : Inherits System.Windows.Forms.Control
.....
End Class
Private Sub BtnBegin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBegin.Click
Dim M_Control as new Mycontrol
Dim stream As Stream = File.Open("Sample.xml", FileMode.Create)
Dim formatter As New System.Runtime.Serialization.Formatters.Soap.SoapFormatter()
formatter.Serialize(stream, M_Control)'这里出问题
stream.Close()
End Sub