Thanks for that information. It is very difficult for me to translate the
code into VB, but I think I see how it is done. I am also trying to learn to
deserialize CodeDOM statements into the designer, and if I can get the VB
back to CodeDom, then that will be the prefered method. Failing that, I will
look at this again, but it seems way to compicated if I can use the CodeDom.
Thanks for the pointer though, and it will certainly help!
[quoted text, click to view] ""Jeffrey Tan[MSFT]"" wrote:
> Hi David,
>
> Thanks for your post.
>
> Yes, this is because Form class did not have SerializableAttribute.
> Actually, we have to do the Xml serialization ourselves. Microsoft has
> released a KB to demonstrate a sample DesignerHost, please refer to the KB
> below:
> "INFO: Code Sample That Demonstrates How to Create a Custom Form Designer
> by Using Visual C# .NET"
>
http://support.microsoft.com/default.aspx?scid=kb;en-us;813808 >
> In this sample, the serialization code is located in SampleDesignerHost.cs
> file. The key xml serialization code is SampleDesignerHost.Flush method. We
> can see that it uses XmlDocument class and other xml classes to serialize
> the controls/components itself. Also, it also provided another way of
> serialization using Code DOM to serialize the controls/components as
> C#/VB.net code file.
>
> I think you may get a lot of useful information from this sample.
>
> Hope this helps
>
> Best regards,
> Jeffrey Tan
> Microsoft Online Partner Support
> Get Secure! -
www.microsoft.com/security > This posting is provided "as is" with no warranties and confers no rights.
>
Hi David,
Thanks for your post.
Yes, this is because Form class did not have SerializableAttribute.
Actually, we have to do the Xml serialization ourselves. Microsoft has
released a KB to demonstrate a sample DesignerHost, please refer to the KB
below:
"INFO: Code Sample That Demonstrates How to Create a Custom Form Designer
by Using Visual C# .NET"
http://support.microsoft.com/default.aspx?scid=kb;en-us;813808 In this sample, the serialization code is located in SampleDesignerHost.cs
file. The key xml serialization code is SampleDesignerHost.Flush method. We
can see that it uses XmlDocument class and other xml classes to serialize
the controls/components itself. Also, it also provided another way of
serialization using Code DOM to serialize the controls/components as
C#/VB.net code file.
I think you may get a lot of useful information from this sample.
Hope this helps
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security This posting is provided "as is" with no warranties and confers no rights.