all groups > dotnet windows forms designtime > september 2005 >
You're in the

dotnet windows forms designtime

group:

Serializing Forms and Controls on a Custom Forms Designer



Serializing Forms and Controls on a Custom Forms Designer David Whitchurch-Bennett
9/15/2005 9:37:03 AM
dotnet windows forms designtime: Hi there,

I have successfully created a custom forms designer in VB.NET 2005, and this
works very well.

However, I cannot seem to see how to load and save the designer's layout,
ie. where the controls are on the form, and their properties. I have tried
several ways, and researched all afternoon.

Can anyone please tell me how to go about this the best way.

Many thanks,

Re: Serializing Forms and Controls on a Custom Forms Designer Jeffrey Tan[MSFT]
9/20/2005 12:00:00 AM
Hi David,

Thanks for your post.

For your statement of "I have successfully created a custom forms designer
in VB.NET 2005", do you mean that you have implemented all the design-time
services of VS.net designer, such as IDesignerHost, etc..? I assume so.

Normally, to load and store the components on the designer, we should
implement a class which inherited from
System.ComponentModel.Design.Serialization.DesignerLoader class. Also, we
should have a class implementing IDesignerSerializationManager interface.
Then we can just code DOM to serialize the components as code file.

Microsoft has released a KB for implementing a customized designer. In this
customized designer, it implemented the save and store function. Please
refer to it:
"HOW TO: Serialize Web Server Controls by Using Visual C# .NET"
http://support.microsoft.com/?id=328547

Note: the serialization code is in SampleDesignerLoader.cs file.

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.

AddThis Social Bookmark Button