Click to See Complete Forum and Search --> : Date/Time Picker


bhatia
May 20th, 1999, 04:28 PM
VC++6.0 / IE5.0

How do I control the checkbox at runtime ?
Is it possible to initialize the date/time string to an empty string ?

TIA

lewis valentine
June 11th, 1999, 07:53 AM
As far as in know you can not initialize to an empty string.

Here is some code to turn on or off the checkbox at run time.
Warning!
Because of the way this work it will rearrage the tab order of you dialog.
I have not found a way around this. If anybody knows a way let me know.


void derived_datepicker_class::ShowNone(BOOL bShow)
{
CRect rc; // the current position of the control
long lStyle; // the control stryle
CWnd *pParent; // the parent of the control
UINT uID; // the resource id of the control

uID = GetDlgCtrlID();
pParent = GetParent();

GetWindowRect(rc);
lStyle = ::GetWindowLong(m_hWnd, GWL_STYLE);

if(bShow)
lStyle |= DTS_SHOWNONE;
else
lStyle &= ~DTS_SHOWNONE;

DestroyWindow();
pParent->ScreenToClient(rc);

Create(lStyle,rc,pParent,uID);
}




This function is made to work in a derived class from the date time picker control. You will need to modify, if you need it else where