Solved

Null Value In DateTmePicker

Posted on 2001-08-03
6
176 Views
Last Modified: 2010-04-06
Hey all,

How do I display no values in the DateTimePicker when the user hasn't entered/selected a date?

When I bring up a new entry screen, all the DateTimePicker dates show the date the component was placed on the form. I don't want it to show anything unless data has been entered.

Thanks,
Chad
0
Comment
Question by:dhertzfe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6351302
Hello

  I think you need to override the a method, maybe CheckEmptyDate, but i'm not sure

0
 

Author Comment

by:dhertzfe
ID: 6352280
Hi mnasman,

There is no method like that for TDateTimePicker.


Chad
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6352716
it's protected method for the TDateTimePicker
Prss Control while u move the move above TDateTimePicker, so when u see it in blue color, click on it, and u will see the source of that control, here's some source of the ComCtrls.pas, that contain all the declartion of TDateTimePicker class

 TDateTimePicker = class(TCommonCalendar)
  private
    FCalAlignment: TDTCalAlignment;
    FChanging: Boolean;
    FChecked: Boolean;
..
..
  protected
    procedure CheckEmptyDate; override;
    procedure CreateParams(var Params: TCreateParams); override;
    procedure CreateWnd; override;
    procedure Change; dynamic;
..

Best regards
Mohammed
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:dhertzfe
ID: 6353232
Hi Mohammed,

I'm using Delphi 6....and I did what you said in the designer on my form with the TDateTimePicker and I didn't see what you where talking about.

How would I write the code to override CheckEmptyDate method to not display the date unless there was a value entered by the user or read from a record?

Thanks,
Chad
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8735385
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

To be PAQ/Refund

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 8822594
Per recommendation,

PashaMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question