.addMinutes在DateTimePickers中不起作用

时间:2016-01-18 15:08:00

标签: vb.net

我在DateTimerPicker添加分钟时遇到问题,我有这段代码:

Console.WriteLine(DateTimePicker1.Value)
'Value returned is => 18/01/2016 16:04:46

我想设置例如30分钟,所以:

Dim min as Double = 30
DateTimePicker1.Values.addMinutes(min)

但价值是均匀的:

  

18/01/2016 16:04:46

我有任何错误。为什么会这样?

1 个答案:

答案 0 :(得分:2)

您需要将值重新分配给datetimepicker控件,如

this.DateTimePicker1.Value = this.DateTimePicker1.Value.addMinutes(min)