SetValue doesn't work with DateTimePicker
I've written my own binding framework using PropertyInfo.SetValue(). It works fine on textboxes, labels, comboboxes and custom controls.
It doesn't work on the Value property of DateTimePicker, however. If I set it, and then read it back, it's correct. However, it does not bear any relation to what is displayed on the control's face.
Example:
Dim [Object] As Object = DateTimePicker1
Dim Value As New DateTime(2006, 08, 24)
Dim P As PropertyInfo = [Object].GetType.GetProperty(MemberInfo.Name, FLAGS, Nothing, Nothing, ArgTypes.ToArray, Nothing)
P.SetValue([Object], Convert.ChangeType(Value, P.PropertyType), Nothing, Nothing, Args, Nothing)
Please help!
|