Solved

TDateTimePicker error - ShowCheckBox mode

Posted on 2001-06-29
4
3,854 Views
Last Modified: 2008-03-03
I have a TDateTimePicker set to "Time" mode.

I have noticed when scrolling through the numbers, sometimes I will get an error message:

Project ... raised exception class EDateTimeError with message 'You must be in ShowCheckbox mode to set this date'.

Now, I noticed that in the Properites for the TDateTimePicker there IS a property called "ShowCheckbox" and it WAS set to false.

Now, I can try setting this to true and see if the error goes away, but what I don't understand is what this error has to do with me scrolling throught e hours or minutes in a TDateTimePicker.

Thanks,

Tom

I am "points poor" so I can only offer 10 points
0
Comment
Question by:knowlton
  • 2
  • 2
4 Comments
 
LVL 5

Author Comment

by:knowlton
ID: 6239519
Looks like the string came from

Delphi4\Source\Vcl\Comstrs.pas :

  sNeedAllowNone = 'You must be in ShowCheckbox mode to set to this date';
0
 

Accepted Solution

by:
ondertol earned 10 total points
ID: 6240492
Probably you set the property "Time" of your TDateTimePicker to not valid value.
If you set the Time value on this mode:

DateTimePicker1.Time := MyTime;

you must control MyTime, probably is not valid Time format.
Create MyTime as:

var
  MyTime : TDateTime

and you must use the instruction EncodeTime (or StrToTime) to set your time:

begin
  MyTime := EncodeTime(10,07,01,5);  

--- or ----

  MyTime := EncodeTime(myHour,MyMin,MySec,myMSec);

--- or ---
 
  MyTime := StrToTime('11.33.44');

end;

!!!remember: the hours are calculated on 24 hours for day


If you want the current time write: "MyTime := Time" or "MyTime := Now";
0
 
LVL 5

Author Comment

by:knowlton
ID: 6240822
Thank you
0
 

Expert Comment

by:ondertol
ID: 6241344
:-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now