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
Code
CultureInfo ci = new CultureInfo("ar-SA");Code
DateTimeFormatInfo info = ci.DateTimeFormat;Code
dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;Code
dateTimePicker1.CustomFormat = info.ShortDatePattern + " " + info.ShortTimePattern;but not working !?
how i can change it in my App?


VulpesRank #55 · 29.2K reputationPosted Aug 6, 2014, 3:34 PM EDT
The DateTimePicker control only supports the Gregorian calendar.
Abhay ShankerRank #375 · 6.7K reputationPosted Aug 6, 2014, 6:06 PM EDT
http://www.microsoft.com/middleeast/msdn/ArabicCalendar.aspx
Max Albish125 reputationPosted Aug 6, 2014, 6:31 PM EDT
Max Albish125 reputationPosted Aug 6, 2014, 6:41 PM EDT
Ankur JainRank #2,475 · 567 reputationPosted Aug 6, 2014, 7:58 PM EDT
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....
VulpesRank #55 · 29.2K reputationPosted Aug 7, 2014, 1:32 AM EDT
http://www.codeproject.com/Articles/23226/Windows-Hijri-Calendar
Max Albish125 reputationPosted Aug 7, 2014, 1:19 PM EDT
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?
VulpesRank #55 · 29.2K reputationPosted Aug 8, 2014, 2:33 AM EDT
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
Abdullah Al-Salem12 reputationPosted May 1, 2020, 3:34 AM EDT