> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Maurice Butler
> Sent: Thursday, 18 February 1999 15:04
> To: Multiple recipients of list delphi
> Subject: Re: [DUG]: Date Selection Component Madness...
>
>
> Simple as it may seem,
> set the MinDate to the date - 1 before you set the date.
> You will also have a similar problem with the MaxDate and you
> need to set it
> to a value greater than what you will need i.e. set it to date+1
> before you
> set the Date. The other catch is if the user sets it to an invalid value
> outside the range you need to force the date into range in your exception
> handler. Also make sure time is set to zero.
Can someone please tell me how you are supposed to catch an exception that
can occur at any time - normally you will place certain statements inside a
try...except loop in case one of them causes an exception. But this
exception is caused by the dumb user not by your code! I think that instead
they should have used an event that fires when the error condition is
detected. Admittedly this is also true of a number of other exceptions like
entering the wrong data format in a database field or trying to edit a
locked record. Which leads me to think you are not supposed to catch this
exception...it is meant to put up a message to warn the user.
============================================
Patrick Dunford, ChristChurch, NZ
http://patrick.dunford.com/
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz