gpt4 book ai didi

c# - 如何解决winform控件的本地语言文本编码问题

转载 作者:太空宇宙 更新时间:2023-11-03 12:56:41 25 4
gpt4 key购买 nike

在 windowsForm Designer 中,我在窗体上放置了一个标签。为其文本属性写了一些土耳其字符。 text > "Giriş" 表示登录。

应用程序启动时,ş 字符显示不正确。某种编码问题

Windows10 有 2 个语言包 > 英语(美国)和土耳其语。英语是默认和当前使用的语言。我不想以编程方式更改设计元素的文本。我想使用 FormDesigner。

这是我在 Windows 窗体设计器中看到的

enter image description here

这是我在运行时看到的

enter image description here

最佳答案

您必须根据 Microsoft's 设置 CurrentCultureCurrentUICulture示例:

// C#
// Put the using statements at the beginning of the code module
using System.Threading;
using System.Globalization;

// Put the following code before InitializeComponent()
// Sets the culture to French (France)
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");

// Sets the UI culture to French (France)
Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR");

您可以在应用程序启动时设置一次。

关于c# - 如何解决winform控件的本地语言文本编码问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33640910/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com