用在第五版上,点击时间对话框的时候,会在下边弹出一个时间对话框, 1.调用 TTime date = iDateEditor->Date(); TBuf<128> prompt(_L("Enter Date:")); CAknTimeQueryDialog* dlg = CAknTimeQueryDialog::NewL(date, CAknQueryDialog::ENoTone); dlg->SetPromptL(prompt); if (dlg->ExecuteLD(R_QUERY2)) { iDateEditor->SetDate(date); } 2.rss资源 //-----------------------------显示时间对话框----------------------------- RESOURCE DIALOG R_QUERY2 { flags = EGeneralQueryFlags; buttons = R_AVKON_SOFTKEYS_OK_CANCEL; items = { DLG_LINE { type = EAknCtQuery; id = EGeneralQuery; control = AVKON_DATA_QUERY { layout = EDateLayout; control = DATE_EDITOR { minDate=DATE //Set the editor's lower date bound. { year=1970; }; maxDate=DATE //Set the editor's upper date bound. { year=2100; }; }; }; } }; }