i try to change the calendar type in dateTimePicker from gregorian to hijri but i cant cuz the system calender type it's gregorian .
i try this code
CultureInfo ci = new CultureInfo("ar-SA"); DateTimeFormatInfo info = ci.DateTimeFormat; dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom; dateTimePicker1.CustomFormat = info.ShortDatePattern + " " + info.ShortTimePattern; but not working !?
how i can change it in my App?

Abdullah Al-SalemPosted May 1, 2020, 7:34 AM
VulpesPosted Aug 8, 2014, 6:33 AM
http://msdn.microsoft.com/en-us/library/windows/desktop/dd374048(v=vs.85).aspx
you'll see that:
"This function only affects the user override portion of the calendar settings. It does not set the system defaults."
But, even if it did, it wouldn't alter the fact that the Windows Forms DateTimePicker control only supports Gregorian calendars.
For proof, scroll down to the Note in the documentation for this control:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datetimepicker(v=vs.110).aspx
Max AlbishPosted Aug 7, 2014, 5:19 PM
i want change system caleder type in c#
I found this function from Kernel32.dll:
BOOL SetCalendarInfo(
_In_ LCID Locale,
_In_ CALID Calendar,
_In_ CALTYPE CalType,
_In_ LPCTSTR lpCalData
);
How can I invoke this method within a C# application?
VulpesPosted Aug 7, 2014, 5:32 AM
http://www.codeproject.com/Articles/23226/Windows-Hijri-Calendar
Ankur JainPosted Aug 6, 2014, 11:58 PM
if its not working, then you can use another third party control with you application, its easy to use, highly customizable, ajax supported and free of cost and its better than any other datepicker...take a look...
http://www.obout.com/calendar/calendar_islamic.aspx
and if you want to do it with date time picker then check these thread, it will help u a lot...
http://www.codeproject.com/Articles/570197/ASP-NET-DatePicker-User-Control-Hijri-Gregorian-Sh
http://www.devasp.net/net/articles/display/276.html
http://www.codeproject.com/Articles/13664/Farsi-Library-Working-with-Dates-Calendars-and-Dat
if its useful please don't forget to mark it as answer....
Max AlbishPosted Aug 6, 2014, 10:41 PM
Max AlbishPosted Aug 6, 2014, 10:31 PM
Abhay ShankerPosted Aug 6, 2014, 10:06 PM
http://www.microsoft.com/middleeast/msdn/ArabicCalendar.aspx
VulpesPosted Aug 6, 2014, 7:34 PM
The DateTimePicker control only supports the Gregorian calendar.