Defines whether week numbers are shown in front of each week.
C
BOOL WINAPI SftDate_GetShowWeekNumbers(HWND hwndCtl); void WINAPI SftDate_SetShowWeekNumbers(HWND hwndCtl, BOOL fShow);
C++
BOOL CSftDate::GetShowWeekNumbers() const; BOOL CSftCalendar::GetShowWeekNumbers() const; void CSftDate::SetShowWeekNumbers(BOOL fShow); void CSftCalendar::SetShowWeekNumbers(BOOL fShow);
hwndCtl
The window handle of the month calendar control (SftCalendar), or of the date field control (SftDate) whose dropdown calendar is affected.
fShow
TRUE if week numbers are shown in front of each week, otherwise FALSE.
GetShowWeekNumbers returns TRUE if week numbers are shown in front of each week, otherwise FALSE.
The GetShowWeekNumbers and SetShowWeekNumbers functions define and retrieve whether week numbers are shown in front of each week. The default is FALSE.
The week numbers are computed using the rule defined using SetWeekNumberRule. Their colors are defined using SetColor (SFTDATE_COLOR_WEEKNUMBERFORE, SFTDATE_COLOR_WEEKNUMBERBACK).
Clicking a week number of a month calendar control in range selection mode (SetSelectionMode) selects the week.
The setting applies to a month calendar control and to the dropdown calendar of a date field control.
case IDC_ACROSS:
SftDate_SetMonthsAcross(hwndCal, sel + 1);
break;
case IDC_DOWN:
SftDate_SetMonthsDown(hwndCal, sel + 1);
break;
case IDC_WEEKNUMBERS:
for (i = 0; i < CONTROLS; ++i) {
SftDate_SetShowWeekNumbers(c[i], sel > 0);
SftDate_SetWeekNumberRule(c[i], sel == 2 ? SFTDATE_WEEKRULE_ISO8601 : SFTDATE_WEEKRULE_CULTURE);
}
break;
case IDC_FIRSTDAY:
for (i = 0; i < CONTROLS; ++i)
SftDate_SetFirstDayOfWeek(c[i], sel);
break;
case IDC_ACROSS:
m_Calendar.SetMonthsAcross(sel + 1);
break;
case IDC_DOWN:
m_Calendar.SetMonthsDown(sel + 1);
break;
case IDC_WEEKNUMBERS:
for (int i = 0; i < CONTROLS; ++i) {
Control(i).SetShowWeekNumbers(sel > 0);
Control(i).SetWeekNumberRule(sel == 2 ? SFTDATE_WEEKRULE_ISO8601 : SFTDATE_WEEKRULE_CULTURE);
}
break;
case IDC_FIRSTDAY:
for (int i = 0; i < CONTROLS; ++i)
Control(i).SetFirstDayOfWeek(sel);
break;See Also C/C++ API | Categories | Notifications