I have a textbox linked to a scrollbar so that when the scrollbar is scrolled to the right it scrolls from 0 to 1440(interval = 1), which is then converted from minutes to a timespan, this timespan is then displayed the textbox, strange thing is, I can only scroll up to 23:51(1431 scrollbar.value) according to the textbox.text
Also,
When I change the time in the textbox to 24:00 it changed it automatically to 0:0 which is not what I want as it is misleading. the time on the left side of the scrollbar is already 0:0. So I'd really prefer for it to say 24:00 instead.
This is the code im currently using. I'm assuming some of the problems are caused by the textbox triggering the scrollbar and the scrollbar triggering the textbox.
'UPDATE TBtstsStart when scrollbar is used
Private Sub SBtstStart_ValueChanged(sender As Object, e As EventArgs) Handles SBtstStart.ValueChanged
Dim time As TimeSpan = New TimeSpan(0, CInt(SBtstStart.Value), 0)
TBtstStart.Text = time.Hours & ":" & time.Minutes
End Sub
'UPDATE SBtstStart when textbox is left
Private Sub TBtstStart_Leave(sender As Object, e As EventArgs) Handles TBtstStart.Leave
Dim strarr() As String = TBtstStart.Text.Split(CChar(":"))
SBtstStart.Value = (CInt(strarr(0)) * 60) + CInt(strarr(1))
End Sub