简体   繁体   English

如何为框架4.0中的所有线程设置UI文化?

[英]How to set up UI culture for all the threads in framework 4.0?

I want to set UI culture for all the threads that are currently running. 我想为当前运行的所有线程设置UI文化。 here is my code 这是我的代码

 ProcessThreadCollection currentThreads = Process.GetCurrentProcess().Threads;

 foreach (ProcessThread thread in currentThreads)
 {
      //How do i set UI culture here.
 }

otherwise is there any other way to do it. 否则还有其他方法可以做到这一点。 I am using 4.0. 我正在使用4.0。 I Know that in 4.5 we have the following 我知道在4.5中我们有以下内容

 CultureInfo.DefaultThreadCurrentUICulture

How do i achieve it in earlier versions. 我如何在早期版本中实现它。 atleast in 4.0? 至少在4.0?

See the answer here . 这里看到答案。

If you want to change the culture of ProcessThread then you have to change the operating system locale. 如果要更改ProcessThread的文化,则必须更改操作系统区域设置。

如果创建线程,则可以使用Thread.CurrentCulture来更改区域性。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何为我的所有resx文件设置相同的区域性? - How can I set the the same Culture for all my resx files? 有没有办法为整个应用程序设置文化? 所有当前线程和新线程? - Is there a way of setting culture for a whole application? All current threads and new threads? 我应该在哪里更改/设置WPF应用程序中的区域性信息设置,为什么? (必须适用于所有.NET Framework 4.0和更高版本) - Where should I change/set culture info settings in my WPF app and why? (Must works on all .NET frameworks 4.0 and newer) MS Test Agent线程未启动系统区域性 - MS Test agent threads not picking up system culture 如何在运行时(.Net Framework 4.0)设置datagridview列的边框样式? - How to set borderstyle of a datagridview column at runtime (.Net Framework 4.0)? 如何在umbraco中树立全球文化? - How to set the culture globally in umbraco? 如何将文化设置为用户为登录页面选择的文化? - How can I set the culture to the user selected culture for the login page? 实体框架:如何建立新的数据库连接并运行所有迁移? - Entity Framework: How to set up new database connection and run all migrations? WPF 覆盖当前文化并未反映在所有控件或 UI 元素中 - WPF Overriding Current Culture is not reflecting in all controls or in UI elements 在 appsettings.json(asp.net 核心本地化)中设置文化和 ui-culture? - Set culture and ui-culture in appsettings.json (asp.net core localization)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM