Sub timer1_Tick
If mp.IsPlaying Then
lblPosition.Text = ConvertToTimeFormat(mp.Position) & " / " & ConvertToTimeFormat(mp.Duration)
End If
End Sub
'converts milliseconds to m:ss format.
Sub ConvertToTimeFormat(ms As Int) As String
Dim seconds, minutes As Int
seconds = Round(ms / 1000)
minutes = Floor(seconds / 60)
seconds = seconds Mod 60
Return NumberFormat(minutes, 1, 0) & ":" & NumberFormat(seconds, 2, 0) 'ex: 3:05
End Sub