简体   繁体   English

Textbox.Text 重新排列字符串内容

[英]Textbox.Text Rearranging String Contents

I am having trouble with setting value of a textbox in code on a winforms application.我在 winforms 应用程序的代码中设置文本框的值时遇到问题。 I must be missing something simple.我一定错过了一些简单的东西。 I've reduced the error down to the following code:我已将错误减少到以下代码:

string val = "11/02/2020 17:52";
txtPhotosVerifiedOn.Text = val;

When I run the program, the textbox displays the following:当我运行程序时,文本框显示以下内容:

17:52 11/02/2020

For the life of me I can't figure out why the textbox is rearranging the date and time.对于我的生活,我无法弄清楚为什么文本框重新排列日期和时间。 It should be a simple string, right?它应该是一个简单的字符串,对吧? Does anyone know why this is happening?有谁知道为什么会这样?

Thanks!谢谢!

Paul保罗

此问题是由 Current Culture 引起的,因此请根据您的要求更改 CurrentCulture 详细信息。

Jimi figured it out.吉米想通了。 The RightToLeft property was set to Yes on these textboxes.这些文本框的RightToLeft属性设置为Yes Setting them to No fixed the problem.将它们设置为No解决了问题。 Thanks again, Jimi!再次感谢吉米!

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM