Solved

TDateTimePicker error - ShowCheckBox mode

Posted on 2001-06-29
4
4,032 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
[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
  • 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

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!

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

734 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