您的位置:首页 > 其它

在运行时切换 WinForm 程序的界面语言

2006-08-22 15:48 357 查看
http://getacoder.cn.cnblogs.com/archive/2006/04/09/370563.html

private void myButton_Click(object sender, EventArgs e)

{

int currentLcid = Thread.CurrentThread.CurrentUICulture.LCID;

currentLcid = (currentLcid == 2052) ? 1033 : 2052;

// Changes the CurrentUICulture property before changing the resources that are loaded for the win-form.

Thread.CurrentThread.CurrentUICulture = new CultureInfo(currentLcid);

// Reapplies resources.

ComponentResourceManager resources = new ComponentResourceManager(typeof(MyForm));

resources.ApplyResources(myButton, "myButton");

resources.ApplyResources(this, "$this");

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: