SetCurSel() doesn't work |
Post Reply |
Author | |
tiratano
Newbie Joined: 15 April 2008 Status: Offline Points: 1 |
Post Options
Thanks(0)
Posted: 15 April 2008 at 10:27pm |
Hi,
I want to change focused date, so I used SetCurSel() function.
However, it didn't work. Here is my code. Is there anyone who can point out the problem?
I'm using Xtreame ToolkitPro 2005 (10.3.1) on Windows XP Professional
==============================================
CXTPDatePickerControl wndDatePicker;
CXTPWindowRect rcPopup(GetDlgItem(IDC_STARTDATE_SEARCH)); CRect rc;
wndDatePicker.GetMinReqRect(&rc); rc.InflateRect(0 ,0, 4, 4); rc.OffsetRect(rcPopup.right - rc.Width(), rcPopup.bottom); COleDateTime dt1(2008, 4, 1, 0, 0, 0);
wndDatePicker.SetCurSel(dt1); // <= why it doesn't work? wndDatePicker.SetButtonsVisible(TRUE, FALSE);
wndDatePicker.SetShowWeekNumbers(TRUE); CString strResult = _T("");
if (wndDatePicker.GoModal(rc, this))
{ COleDateTime dtFrom; COleDateTime dtTo; if (wndDatePicker.GetSelRange(dtFrom, dtTo))
{ if (dtFrom == dtTo) { strResult.Format(_T("%4d-%02d-%02d"), dtFrom.GetYear(), dtFrom.GetMonth(), dtFrom.GetDay()); } else { // edit strResult.Format(_T("%4d.%02d.%02d - %4d.%02d.%02d"), dtFrom.GetYear(), dtFrom.GetMonth(), dtFrom.GetDay(), dtTo.GetYear(), dtTo.GetMonth(), dtTo.GetDay()); } } else strResult = strCurrentText; } else strResult = strCurrentText; this->m_StartDateEdit.SetWindowText(strResult);
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |