Solved

Null Value In DateTmePicker

Posted on 2001-08-03
6
175 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
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi IDE crash without error message ... 7 99
Convert a string into a TDateTime 5 63
Adoquery sql  left join does not work 25 98
DBGrid or StringGrid ? 6 103
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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