Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TDateTimePicker error - ShowCheckBox mode

Posted on 2001-06-29
4
Medium Priority
?
4,252 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 40 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

722 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