all groups > dotnet windows forms designtime > july 2004 >
You're in the

dotnet windows forms designtime

group:

User Controls Property VS .resx files


User Controls Property VS .resx files Tony
7/30/2004 5:03:43 PM
dotnet windows forms designtime: Hi all,

I have a simple question here. I developed a user control which inhreits
from the UserControl class. I exposed an custom property and then build the
project. In another project, I added this control to a Window Form, set that
property to a value, save and build the project. Everything gone well.
However, after I close the Form and open it again, the property is reset to
the default value. I looked into the .resx file, and there is no entry for
that custom property, so I am wondering how can I save the value of the
custom property I created to the .resx file?

Thanks for answering.

Tony

Re: User Controls Property VS .resx files Jörg Neumann
8/10/2004 11:15:34 AM
Set the following two attributs to the property:

[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Localizable(true)]

But when the property is a custom type, you must implement a TypeConverter
class and bind it to the property with the TypeConverter attribut.

Check also Your DefaultValue attribut. Sometimes it cause problems, when You
set it to null.

Jörg Neumann

"Tony" <tony@askme.com> schrieb im Newsbeitrag
news:esECfQhdEHA.4092@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button