Solved

TDateTimePicker error - ShowCheckBox mode

Posted on 2001-06-29
4
3,994 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:Tom Knowlton
  • 2
  • 2
4 Comments
 
LVL 5

Author Comment

by:Tom 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:Tom Knowlton
ID: 6240822
Thank you
0
 

Expert Comment

by:ondertol
ID: 6241344
:-)
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Print Graphic and Text to Epson TM-T88v 12 457
Delphi 2 77
creating threads in delphi 1 157
Convert MS Word document to a PDF file 9 114
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

685 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