DateTimePicker does not use custom format string

I am using winforms DateTimePicker with custom formatting applied to it:

 this.dateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom; this.dateTimePicker.CustomFormat = "MM/dd/yyyy HH:mm"; this.dateTimePicker.RightToLeftLayout = false; 

On my machine, this works fine, but on a specific user computer, the date is not printed in accordance with this user format.

Instead, it seems that the date is printed backwards, something like:

 "35:10 2013/05/23" 

I could not find network information why this is happening.

+4
source share
1 answer

try it

 if (CultureInfo.CurrentCulture.TextInfo.IsRightToLeft) { this.dateTimePicker.RightToLeftLayout = true; } else { this.dateTimePicker.RightToLeftLayout = false; } 
+1
source

Source: https://habr.com/ru/post/1482359/


All Articles