Calendar for WinForms | ComponentOne
In This Topic
    Globalization
    In This Topic

    The Calendar controls such as CalendarView and DateEdit allow you to change regional settings to display the calendar UI in specific locales or languages and set right-to-let support.

    Let's explore culture settings and right-to-left support in detail using the Calendar controls.

    CalendarView

    CalendarView supports built-in globalization to use it in different languages and cultures in the following ways:

    DateEdit

    DateEdit supports built-in globalization to use it in different languages and cultures in the following ways:

    The following image shows DateEdit with Arabic culture in right-to-left direction.

    DateEdit with Arabic culture

    The following code snippet shows how to set the current culture and enable right-to-left functionality in the DateEdit control.

    C#
    Copy Code
    // set the culture
    dateEdit.CultureInfo = new System.Globalization.CultureInfo("ar-IQ");
    // enable right to left functionality
    dateEdit.RightToLeft = RightToLeft.Yes;
    dateEdit.Calendar.DayNameLength = 4;
    

    You can also set the DateEdit with Japanese culture:

    DateEdit with Japanese culture

    The following code snippet shows how to set the Japanese culture in the DateEdit control:

    C#
    Copy Code
    dateEdit.CultureInfo = new System.Globalization.CultureInfo("ja-JP");
    dateEdit.Calendar.CalendarType = C1.Win.Calendar.CalendarType.JapaneseCalendar;
    dateEdit.Calendar.CaptionFormat = "gg yyyy年 MM";