MIchael,
You should be able to set the Value of your Time picker to the Date of the
Date picker & the Time of the Time picker, when the Date picker's value
changes.
Something like:
Private Sub pickerDate_ValueChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles pickerDate.ValueChanged
pickerTime.Value =
pickerDate.Value.Date.Add(pickerTime.Value.TimeOfD ay)
End Sub
Private Sub pickerTime_ValueChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles pickerTime.ValueChanged
Me.labelDateTime.Text = pickerTime.Value.ToString()
End Sub
Where pickerDate is a DateTimePicker for the Date value & pickerTime is a
DateTimePicker for the Time value.
I would consider encapsulating both controls into a new User Control to
allow easier reuse & better encapsulation...
Hope this helps
Jay
"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:ut**************@TK2MSFTNGP10.phx.gbl...
Hi Guys
I have two DateTime pickers one shows the Date and the other the time,
this is a requirement of the solution. The problem I have is that when the
time is saved to the sql database into a datetime field it uses the
default date which is a problem when I try to sort, what I wanted to know
is there a way for me to set the date in the time picker to the date in
the date picker?
Any help greatly appreciated.
Thanks
Mike