Discussion:
CDateTimeCtrl and blank dates
(too old to reply)
William Gower
2003-10-03 16:15:32 UTC
Permalink
Ok, I am able to detect the check box being unchecked in the date field and
I call SetFormat(" ") which blanks out the date text. But when I call
GetTime(m_dtPurchaseDate) it still has my date in it. I try using SetTime("
") and the compiler doesn't like that line.
Geo
2003-10-03 16:58:59 UTC
Permalink
Hi again,

SetFormat(" ") controls only the way the CDateTimeCtrl is
displayed. The date (and time) will still exist.

As for your question, it is not clear what is it that you
want to do!

Geo
-----Original Message-----
Ok, I am able to detect the check box being unchecked in
the date field and
I call SetFormat(" ") which blanks out the date text.
But when I call
GetTime(m_dtPurchaseDate) it still has my date in it. I
try using SetTime("
") and the compiler doesn't like that line.
.
William Gower
2003-10-03 17:04:35 UTC
Permalink
I would like the user to have the ability to blank out a date that was
already saved in a previous edit session.
Post by Geo
Hi again,
SetFormat(" ") controls only the way the CDateTimeCtrl is
displayed. The date (and time) will still exist.
As for your question, it is not clear what is it that you
want to do!
Geo
-----Original Message-----
Ok, I am able to detect the check box being unchecked in
the date field and
I call SetFormat(" ") which blanks out the date text.
But when I call
GetTime(m_dtPurchaseDate) it still has my date in it. I
try using SetTime("
") and the compiler doesn't like that line.
.
Geo
2003-10-03 17:51:17 UTC
Permalink
I'm not sure I understood. But anyhow, here are some
ideas:

CDateTimeCtrl::SetDate(COleDateTime date)
CDateTimeCtrl::SetTime(COleDateTime time)
COleDateTime::SetStatus(COleDateTime::null) //To indicate
that no date/time is set
COleDateTime::GetStatus() //To check whether date/time is
set

If the date (or time) is already saved, you can set the
date (or time) of your CDateTimeCtrl object to
COleDateTime::null, then set its format to blank it out.

Hope this will help.

Geo
-----Original Message-----
I would like the user to have the ability to blank out a
date that was
already saved in a previous edit session.
Post by Geo
Hi again,
SetFormat(" ") controls only the way the CDateTimeCtrl
is
Post by Geo
displayed. The date (and time) will still exist.
As for your question, it is not clear what is it that
you
Post by Geo
want to do!
Geo
-----Original Message-----
Ok, I am able to detect the check box being unchecked
in
Post by Geo
the date field and
I call SetFormat(" ") which blanks out the date text.
But when I call
GetTime(m_dtPurchaseDate) it still has my date in
it. I
Post by Geo
try using SetTime("
") and the compiler doesn't like that line.
.
.
Loading...