我有两个datetimepicker ..让我们说它是datetimepicker1和datetimepicker2。当我使用datetimepicker1选择日期时,datetimepicker2 mimimumdate将成为datetimepicker1的日期。在此先感谢!
答案 0 :(得分:0)
这对你来说很合适。我将两个控件拖到表单上,然后在DateTimePicker1.ValueChanged Event
Private Sub DateTimePicker1_ValueChanged(sender As Object, e As System.EventArgs) Handles DateTimePicker1.ValueChanged
DateTimePicker2.MinDate = DateTimePicker1.Value 'Set the min value
DateTimePicker2.Value = DateTimePicker1.Value 'Set the date to second picker from the first one
End Sub
我根本没有处理第二个DateTime
控件,不知道你想用它做什么......