Since you are always dealing with month values, disregarding the year
and day (if I'm not mistaken), why don't you use a combo box with 12 items.
MonthCombo.ItemIndex := IntToStr(F_Month) - 1;
Remember that item indexes start from 0, so the itemindex range on the
combo is 0..11
One more thing, using a TDateTimePicker will always show you the
calendar in the dropdown panel, and might be confusing for the user who is
allowed to choose years, months and even days but only see month at the
end...
Vahan
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] Behalf
Of soonhuat ong
Sent: Friday, July 29, 2005 11:54 AM
To: [email protected]
Subject: Re: [delphi-en] TDatetimepicker problem
I have a field 'F_MONTH' with datatype string.
Now i want to get the value from F_MONTH, and display it on DateTimePicker1
component.
For example: 03 will display March, 02 will display February.
I know 29th of Februrary isn't a valid date, and i don't even have this
value in my database, the value just come out by itself. Try to drop a
DateTimePicker1 component, and set its format property to 'MMM', then on
buttonA click event write the following code then you'll get what error i
mean:
ButtonAClick Event :
DateTimePicker1.Date := recodemonth(Now, StrToInt('02'));
See i don't have any value with '29', i only pass 02 and want it to return
me "February".
Thanks again.
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
Hi,
the 29th of february in 2005 is indeed an invalid date, you should trust to
the
errormessage ,-)
So if you tell us exactly what you really want to do, we might provide you
with a solution...
Bob
> But it give me the following error :
> "2005/2/29 is not a valid date and time" .
>
> What's wrong with the code ? and how should i get it fixed ? Thanks
in advance
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "delphi-en" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
----------------------------------------------------------------------------
----
YAHOO! GROUPS LINKS
a.. Visit your group "delphi-en" on the web.
b.. To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
----------------------------------------------------------------------------
----
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12ha05qk7/M=362329.6886308.7839368.1510227/D=groups/S=1705115362:TM/Y=YAHOO/EXP=1122639152/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~->
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/