HeaderPane
Main
Hide
Share Link
Print

FirstDayOfWeekEnum Enumeration

Defines the first day of the week shown in a calendar.

Namespace: Softelvdm.SftDateNET
Assembly: Softelvdm.SftDateNET

Syntax

public enum FirstDayOfWeekEnum;
Public Enum FirstDayOfWeekEnum

Values

NameDescription
DefaultThe first day of the week defined by the culture.
SundaySunday.
MondayMonday.
TuesdayTuesday.
WednesdayWednesday.
ThursdayThursday.
FridayFriday.
SaturdaySaturday.

Comments

Defines the first day of the week shown in a calendar.

Examples

C# View entire sample code

                "Persian (Iran), Persian calendar",
            });
            comboCulture.SelectedIndex = 0;
            FillCombo(comboDarkMode, typeof(DarkModeEnum), sftCalendar1.DarkMode);
            FillCombo(comboHighContrast, typeof(HighContrastModeEnum), sftCalendar1.HighContrastMode);
            FillCombo(comboButtons, typeof(FieldButtonsEnum), sftDate1.Buttons);
            comboWeekNumbers.Items.AddRange(new object[] { "None", "Culture rule", "ISO 8601" });
            comboWeekNumbers.SelectedIndex = 0;
            FillCombo(comboFirstDay, typeof(FirstDayOfWeekEnum), sftCalendar1.Calendar.FirstDayOfWeek);
            ShowSelection();
        }

        private void FillCombo(ComboBox combo, Type enumType, object current) {
            foreach (object value in Enum.GetValues(enumType))
                combo.Items.Add(value);
            combo.SelectedItem = current;

VB.NET View entire sample code

            "Thai (Thailand), Buddhist calendar",
            "Persian (Iran), Persian calendar"})
        ComboCulture.SelectedIndex = 0
        FillCombo(ComboDarkMode, GetType(DarkModeEnum), SftCalendar1.DarkMode)
        FillCombo(ComboHighContrast, GetType(HighContrastModeEnum), SftCalendar1.HighContrastMode)
        FillCombo(ComboButtons, GetType(FieldButtonsEnum), SftDate1.Buttons)
        ComboWeekNumbers.Items.AddRange(New Object() {"None", "Culture rule", "ISO 8601"})
        ComboWeekNumbers.SelectedIndex = 0
        FillCombo(ComboFirstDay, GetType(FirstDayOfWeekEnum), SftCalendar1.Calendar.FirstDayOfWeek)
        ShowSelection()
    End Sub

    Private Sub FillCombo(ByVal combo As ComboBox, ByVal enumType As Type, ByVal current As Object)
        For Each value As Object In [Enum].GetValues(enumType)
            combo.Items.Add(value)
        Next

See Also Classes | SftDate/NET 3.0