*****User controls in Winform can not be localized

本文探讨了在使用Visual Studio 2008时遇到的用户控件无法本地化的问题,并提供了通过标记控件属性为可本地化以及手动调整资源文件等解决方案。
from:
http://social.msdn.microsoft.com/Forums/en/netfxbcl/thread/54884c78-74a7-40b7-8a4e-44ee4abc7717

I am using VS2008. I have a form which contains several usercontol. I am trying to localize the form to another lanuage.
I changed the localizable property of the form to true, change the languange to the one I want to use, let's say spanish. Then change some usercontrol text.
however, when I went back to default language, some user control works well, some bring content in spanish back.
I checked the resx file, the controls which not work well, thier .text property not exist in the resx file generated by VS. I added them in to the resx file and the spanish resx manually, rebuild, still not work, some of the strings I added in the resx files deleted by the system automatically...

why these usercontrols can not be localized? things happened on some buttons too

Please help.

------------------------------
A UserControl has its own Localizable and Language property in the designer, independent of the Form on which it is placed.  You will have to localize it all by itself.

You can mark public properties that you added to the UC as localizable as well so that the form's localization alters the property value.  Easy to do:

    [Localizable(true)]
    public string SomeText { get; set; }

Hans Passant.

转载于:https://www.cnblogs.com/luoyaoquan/archive/2011/10/28/2228007.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值