private sub DatetimePicker_ValueChanged(.................................)
Dim diffTime as TimeSpan = dateTimePickerEnd.Value = dateTimePickerStart.Value
Dim mydate as Integer = CInt(diffTime.Days) + 1
TextBox1.Text = mydate
end sub
Date :
2012-08-22 17:14:25
By :
Nameless
No. 7
Guest
Code (VB.NET)
Private Sub DateTimePicker1_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged
Dim diffTime As TimeSpan = DateTimePicker2.Value - DateTimePicker1.Value
Dim mydate As Integer = CInt(diffTime.Days) + 1
mydate = Val(Label5.Text)
total = Val(Label11.Text)
If mydate < 15 Then
Label5.Text = 0
Else
mydate = total * 10 / 100
Label5.Text = CStr(mydate) 'CStr() ฟังก์ชัน แปลงตัวเลขให้กลับมาเป็นข้อความ'
End If
End Sub
มันขึ้น ยึกๆๆ สีน้ำเงินคำว่า total อ่ะค่ะ
จะว่ายังไม่ได้เรียกใช้ก็ไม่ใช่ ทำไงดี