Page 1 of 1

Possible to have a blank date with Date Picker ?

PostPosted: Wed Apr 04, 2012 3:04 pm
by Rick Lipkin
To All

I am in the process of re-writing an old VB program and want to have the same functionality as the old application.

There is a Date Picker option on a date field that is blank ( ctod("00/00/00") ) .. and I want to leave it as blank, unfortunately when I use the DtPicker option by default todays date is displayed.

I am passing ctod("00/00/00") to the date picker but I can not seem to get the control to give me a blank date ?

Consider this code and see pics.

Thanks
Rick Lipkin

Code: Select all  Expand view

// DatePick Example

#include "fivewin.ch"
#include "dtpicker.ch"


//-------------------------------
FUNCTION main()

Local oDlg, dDate,oDate,oBtn1

SET CENTURY ON

dDate := ctod("00/00/00")

DEFINE DIALOG oDlg RESOURCE "TESTDP"

   REDEFINE DTPICKER oDate VAR dDate ID 128 OF oDlg UPDATE PICTURE '@D'

   REDEFINE BUTTON oBtn1 ID 129 OF oDlg ;
            ACTION oDlg:End()

ACTIVATE DIALOG oDlg CENTERED

RETURN NIL

// end

 


.rc

Code: Select all  Expand view

TESTDP DIALOG 89, 44, 207, 152
STYLE WS_POPUP | WS_CAPTION
FONT 6, "MS Sans Serif"
{
 LTEXT "Blank Date", 132, 6, 40, 84, 11, SS_NOPREFIX | WS_GROUP
 CONTROL "", 128, "SysDateTimePick32", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 96, 38, 73, 13
 PUSHBUTTON "Close", 129, 124, 104, 50, 14
}
 


Pic of Vb App
Image

Pic of my app
Image

Re: Possible to have a blank date with Date Picker ?

PostPosted: Wed Apr 04, 2012 8:35 pm
by Gale FORd
Change the option after "SysDateTimePick32" to 2. This will add a little checkbox that replaces a black date.
If it is NOT checked then it is a blank date.

Example:
CONTROL "", 1009, "SysDateTimePick32", 2 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 377, 3, 67, 12

Image

Re: Possible to have a blank date with Date Picker ?

PostPosted: Wed Apr 04, 2012 10:03 pm
by Rick Lipkin
Gale

Thanks alot, works great .. Appreciate your Help!

Rick Lipkin

Re: Possible to have a blank date with Date Picker ?

PostPosted: Thu Apr 05, 2012 7:17 am
by Maurizio
in Date Picker
is it possible to go manually from day to month to year without pressing return ?

Regards Maurizio
www.nipeservice.com

Re: Possible to have a blank date with Date Picker ?

PostPosted: Thu Apr 05, 2012 1:50 pm
by Gale FORd
The only way I have found is to use "/" or right/left arrows. If you are entering a date then go ahead and enter the slash along with the numbers and it will work correctly.