I need to add seconds to 开发者_运维技巧the value of DateTimePicker. Can anyone tell me why the value remains unchanged after executing following code? And also I want to change the displayed value of DateTimePicker to its new value. This should be easy. mmm I dont know why.
Thanks.
protected override void updateTime(uint seconds)
{
this.dtPicAdmitDate.Value.AddSeconds(seconds);
}
AddSeconds() will return a new DateTime object. Try:
this.dtPicAdmitDate.Value = this.dtPicAdmitDate.Value.AddSeconds(seconds);
精彩评论