标签:自动 sources model 控件 inf global 属性 代码 c#
考虑到程序的国际化需求,需要为程序设置多语言界面。
1,新建一个资源文件,名字可以是对应界面+语言代码(MainForm.zh-CN)。这样资源文件就会自动添加到对应界面下面。
2,更改界面属性Localizable为Ture
3,调用相关的资源文件,为相关控件赋值
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(language);
if (form != null)
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(formType);
resources.ApplyResources(form, "MainForm");
//AppLang(form, resources);
}
标签:自动 sources model 控件 inf global 属性 代码 c#
原文地址:http://www.cnblogs.com/xuganhua2012/p/6365751.html