Date and Time Ctrl



  • Hallo NG,

    ich bitte erneut um Hilfe.

    Es geht um CDateTimeCtrl.

    CDateTimeCtrl* pmyDTP1 = new CDateTimeCtrl();
    pmyDTP1->Create(WS_VISIBLE | WS_CHILD | WS_TABSTOP | DTS_SHOWNONE | DTS_SHORTDATEFORMAT,CRect(left2,top,right2,bot), this, IDC_E1B);
    

    Wie kann ich bitte ein benutzerdefiniertes Format einstellen?

    Ich weiß, dass es die DTM_SETFORMAT Message gibt, jedoch kann ich nicht mit dieser umgehen.

    Vielen Dank für die Hilfe.

    Gruß Walter



  • !!! MSDN !!!

    void CDatesDlg::OnButton2() 
    {
       // Gain a pointer to the control
       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"));
    }
    


  • Sorry,

    aber genau das was Du schreibst, finde ich in "meiner" MSDN nicht.

    Habe ja gesucht.

    Danke!

    Gruß Walter


Anmelden zum Antworten