Marco,
The datetime picker control does behave differently in one aspect from VB6,
which I believe is bug. Assuming you set the value of the control on form
initialization, I have found that the first change event is not fired when
the user clicks the check box.
As a work around on form initialization I have found it necessary to
initialize the value and the checked status of the DTP control (in this
order) and then set the actual values, for instance:
Me.dtpStartDate .Value = Now()
Me.dtpStartDate .Checked = False
.... set the appropriate values
You must understand that un-checking the control does NOT (a) disable the
control (b) set the value to null. Un-Checking the control only makes the
control appear to be disabled, further clicking or drop down of the picker
will automatically enable the control.
Regards,
Dan
"Marco Castro" <ma************ **@benlan.com> wrote in message
news:%2******** *******@tk2msft ngp13.phx.gbl.. .
Is it just me or does the Checked property of the DateTimePickers not work
properly?
I was trying to set it to off (which should disable the editing of the
control) to indicate that its a null value.
However sometimes when I do set it to off the control doesn't change. If
you read back the value it will say thats its not checked but the
controls is still checked and you can edit the values.
I can't even see a patern to when it decides to do it. Does anyone have
an explanaition for this and hopefully a work around? Thanks for any help.