Capture Designer Code

L

localhost

How can I capture all of the layout code from the designer into the
"code behind" of a WinForm?

For example, if I drag a textbox on a form and then modify the
CharacterCasing property in the designer, it appears in the code. But
virtually no other properties show unless I change them as well.

How can I get every PEM for every control to show in my "code behind"?

Thanks.
 
Y

Ying-Shen Yu[MSFT]

Hi,


This is a by-design behavior, the code-serialization mechiansim will check
the result of the call to PropertyDescriptor.ShouldSerializeValue on a
certain property.
If it return false, then this property will not be serialized into code.



When the Form is loading, these properties is left with their initial value
unchanged. Why you need serilialized all of them into code? And I'm not
clear about the meaing of the abbreviation "PEM". Could you make it clear
for me?
If you only want to serialize all your properties for your own component,
you may implement the ICustomTypeDescriptor interface to return your own
PropertyDescriptor. Always return true in your ShouldSerilializeValue
method.

You can find a good sample about ICustomTypeDescriptor in .NET Framework
SDK sample directory:
\SDK\v1.1\Samples\Tutorials\resourcesandlocalization\reseditor


If you have anything unclear on this issue, please feel free to reply this
thread.
Thanks!



Best regards,

Ying-Shen Yu [MSFT]
Microsoft community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top