Datum in einem CDateTimeCtrl ändern
-
Ein Datum mit der CDateTimeCtrl einstellen ist praktisch. Aber wenn ich ein Datum mittels SetWindowText in das Feld schreiben möchte, funktioniert das irgendwie nicht. GetWindowText zum auslesen geht aber.
Gruß Ronny
-
Schon erledigt.
CDateTimeCtrl* pCtrl = (CDateTimeCtrl*) GetDlgItem(IDC_DATETIMEPICKER1); ASSERT(pCtrl != NULL); // The control will create itself with a format that matches the // locale setting in Control Panel. But we can force a particular // format with a call to SetFormat(). This call forces the format // dd-MMM-yy, which would show 03-APR-98 for April 3rd, 1998. pCtrl->SetFormat(_T("dd-MMM-yy"));