我有一个自定义向导控件,我正在使用Title和SubTitle进行修改。如何在控件中保存和本地化字符串?这是SubTitle属性:
[Category("Appearance"), DefaultValue("Description for the new page."), Description("The subtitle of the page."), Editor(typeof(MultilineStringEditor), typeof(UITypeEditor))]
public string Subtitle
{
get { return subtitle; }
set
{
if (subtitle != value)
{
Region regionToInvalidate = GetTextRegionToInvalidate();
subtitle = value;
regionToInvalidate.Union(GetTextRegionToInvalidate());
Invalidate(regionToInvalidate);
}
}
}
答案 0 :(得分:3)
只需添加Localizable属性
即可[Category("Appearance"), DefaultValue("Description for the new page."), Description("The subtitle of the page."), Editor(typeof(MultilineStringEditor), typeof(UITypeEditor))]
[Localizable(true)]
public string Subtitle
{
get { return subtitle; }
set
{
if (subtitle != value)
{
Region regionToInvalidate = GetTextRegionToInvalidate();
subtitle = value;
regionToInvalidate.Union(GetTextRegionToInvalidate());
Invalidate(regionToInvalidate);
}
}
}