FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Possible to have a blank date with Date Picker ?
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Possible to have a blank date with Date Picker ?
Posted: Wed Apr 04, 2012 03:04 PM
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 (fw): Select all Collapse
// 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 (fw): Select all Collapse
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


Pic of my app
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: Possible to have a blank date with Date Picker ?
Posted: Wed Apr 04, 2012 08:35 PM
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

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Possible to have a blank date with Date Picker ?
Posted: Wed Apr 04, 2012 10:03 PM

Gale

Thanks alot, works great .. Appreciate your Help!

Rick Lipkin

Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Possible to have a blank date with Date Picker ?
Posted: Thu Apr 05, 2012 07:17 AM

in Date Picker
is it possible to go manually from day to month to year without pressing return ?

Regards Maurizio

www.nipeservice.com

Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: Possible to have a blank date with Date Picker ?
Posted: Thu Apr 05, 2012 01:50 PM

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.

Continue the discussion