将DateTimePicker减去文本框值,答案就在另一个文本框中

时间:2018-10-25 03:47:42

标签: vb.net

我正在尝试解决并获取程序中的总运行时间。以下是示例:

提前谢谢!

获取两个datetimepicker的Datediff,然后减去Datediff和文本框值的总和。

Dim HoursDiff = DateDiff(DateInterval.Hour, DTPTS.Value, DTPTE.Value)

            Dim minutesDiff = DateDiff(DateInterval.Minute, DTPTS.Value, DTPTE.Value)

            Dim totalMin As Integer = minutesDiff Mod 60

            Dim TotalTOT As String = HoursDiff & ":" & totalMin

            Dim totalcomTOT As Integer = TotalTOT - txtboxDownTime.text

            TxtboxTOTint.Text = totalcomTOT

0 个答案:

没有答案