[英]Left to right for DateTimePicker in C#
I have a DateTimePicker
with this properties: 我有一个具有以下属性的
DateTimePicker
:
this.CustomFormat = "HH:mm";
this.Format = DateTimePickerFormat.Custom;
this.ShowUpDown = true;
this.Text = "08:45";
everything ok, but when i changed format to persian in control panel: 一切正常,但是当我在控制面板中将格式更改为波斯语时:
my time change to "45:08" 我的时间更改为“ 45:08”
I want to be this way: "08:45" 我想这样:“ 08:45”
You are probably looking for DateTimePicker.RightToLeftLayout Property 您可能正在寻找DateTimePicker.RightToLeftLayout属性
Gets or sets whether the contents of the DateTimePicker are laid out from right to left.
获取或设置DateTimePicker的内容是否从右到左布置。
Something like this: 像这样:
if (CultureInfo.CurrentCulture.TextInfo.IsRightToLeft)
{
this.dateTimePicker.RightToLeftLayout = true;
}
else
{
this.dateTimePicker.RightToLeftLayout = false;
}
Also check What is RightToLeftLayout? 还要检查什么是RightToLeftLayout?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.