Solved

TDateTimePicker error - ShowCheckBox mode

Posted on 2001-06-29
4
3,801 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
APK file name 7 64
How to use Hashing sha1 in Delphi 2010 4 163
delphi exception 7 58
Delphi XE10 Round Image 2 53
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 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