Possible to have a blank date with Date Picker ?

Possible to have a blank date with Date Picker ?

Postby Rick Lipkin » Wed Apr 04, 2012 3: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: 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
User avatar
Rick Lipkin
 
Posts: 2642
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

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

Postby Gale FORd » Wed Apr 04, 2012 8: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

Image
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

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

Postby Rick Lipkin » Wed Apr 04, 2012 10:03 pm

Gale

Thanks alot, works great .. Appreciate your Help!

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2642
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

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

Postby Maurizio » Thu Apr 05, 2012 7: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
User avatar
Maurizio
 
Posts: 799
Joined: Mon Oct 10, 2005 1:29 pm

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

Postby Gale FORd » Thu Apr 05, 2012 1: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.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 120 guests