display number in time format
Hi All.
I have parent DGV form and child Detail form. The user enter data in Detail from, for instance, the field AbsenceDays keep number of days like integer. If it possible, how to display in DGV that number in time format HHH:00?
Example: user will enter 5 in field AbsenceDays but in DGV I would like to display 35:00.
Thanks.
Re: display number in time format
Maybe I am missing something but why would 35 be equivalent to 5:confused:
Re: display number in time format
You need to write a fragment code to format it.
like this:
Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim The_time as integer
Dim mm, ss As Integer
mm = Int(The_Time / 60)
ss = The_Time Mod 60
Time_Label.Text = (Format(mm, "00") & ":" & Format(ss, "00"))
The_Time += 1
End Sub
Re: display number in time format
Quote:
Originally Posted by
CoachBarker
Maybe I am missing something but why would 35 be equivalent to 5:confused:
I can only assume that 5 days at 7 hours a day is 35 hours. Of course, it would be nice if people were to explain things in the first place so we didn't have to assume. If that is the case then it would simply be:
vb.net Code:
Dim days = 5
Dim hours = days * 7
MessageBox.Show(hours.ToString("0':00'"))