View previous topic :: View next topic |
Author |
Message |
CodeIt
Joined: 07 Oct 2009 Posts: 1
|
Posted: Wed Oct 07, 2009 1:57 pm Post subject: UserControl property localization |
|
|
I recently purchased Globalizer.net. It saves me a lot of work. However i have one issue. I have a form (which overrides from anohter form) with a usercontrol on it (same project). This usercontrol has a property, called 'DisplayText'. I'm able to set this property in the Visual Studio Designer. When scanning the form (without any filters) Globalizer.NET won't find my 'DisplayText' property.
Is there something i did wrong, or do i need to add some sort of property attribute to my property? |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Oct 07, 2009 9:42 pm Post subject: |
|
|
If you are defining a custom property on a user control then you need to add the Localizable attribute to the property. This tells .NET that the property needs to be serialized from localized resources. The following code shows how to do this:
Code: | [Localizable(true)]
public string ToolTip
{
get { return _toolTip; }
set { _toolTip = value; }
} |
_________________ Infralution Support |
|
Back to top |
|
|
|