Defines whether the check box of a date field control is checked.
C
BOOL WINAPI SftDate_GetChecked(HWND hwndCtl); void WINAPI SftDate_SetChecked(HWND hwndCtl, BOOL fChecked);
C++
BOOL CSftDate::GetChecked() const; void CSftDate::SetChecked(BOOL fChecked);
hwndCtl
The window handle of the date field control (SftDate).
fChecked
TRUE to check the check box, FALSE to clear it.
GetChecked returns TRUE if the check box is checked, otherwise FALSE.
The GetChecked and SetChecked functions define and retrieve the state of the check box shown using SetShowCheckBox. The default is TRUE.
While the check box is shown and cleared, the field has no value (GetValue returns FALSE). A change that alters whether the field has a value sends the NM_SFTDATE_VALUECHANGED notification. The state is kept while the check box is hidden. This function applies to the date field control only. For a month calendar control, GetChecked returns FALSE and SetChecked has no effect.
SftDate_SetTimeDropDownStyle(GetDlgItem(hwndDlg, IDC_TIMECLOCK), SFTDATE_TIMESTYLE_CLOCK);
SftDate_SetFormat(GetDlgItem(hwndDlg, IDC_DATETIME), SFTDATE_FORMAT_SHORTDATETIME);
SftDate_SetSelectionMode(GetDlgItem(hwndDlg, IDC_RANGE), SFTDATE_SELECTION_RANGE);
SftDate_SetRange(GetDlgItem(hwndDlg, IDC_RANGE), &now, &weekLater);
SftDate_SetShowCheckBox(GetDlgItem(hwndDlg, IDC_OPTIONAL), TRUE);
SftDate_SetChecked(GetDlgItem(hwndDlg, IDC_OPTIONAL), FALSE);
SftDate_SetAllowEmpty(GetDlgItem(hwndDlg, IDC_EMPTY), TRUE);
SftDate_SetPlaceholderText(GetDlgItem(hwndDlg, IDC_EMPTY), TEXT("No date"));
SftDate_SetShowClearButton(GetDlgItem(hwndDlg, IDC_EMPTY), TRUE);
SftDate_SetValue(GetDlgItem(hwndDlg, IDC_EMPTY), NULL);
SftDate_SetEditStyle(GetDlgItem(hwndDlg, IDC_FREEFORM), SFTDATE_EDIT_FREEFORM);
m_Fields[3].SetTimeDropDownStyle(SFTDATE_TIMESTYLE_CLOCK);
m_Fields[4].SetFormat(SFTDATE_FORMAT_SHORTDATETIME);
m_Fields[5].SetSelectionMode(SFTDATE_SELECTION_RANGE);
m_Fields[5].SetRange(&now, &weekLater);
m_Fields[6].SetShowCheckBox(TRUE);
m_Fields[6].SetChecked(FALSE);
m_Fields[7].SetAllowEmpty(TRUE);
m_Fields[7].SetPlaceholderText(_T("No date"));
m_Fields[7].SetShowClearButton(TRUE);
m_Fields[7].SetValue(NULL);
m_Fields[8].SetEditStyle(SFTDATE_EDIT_FREEFORM);See Also C/C++ API | Categories | Notifications