Hvis vi nu siger at dit MediaPlayer objekt hedder "player", så kan du gøre følgende (koden viser hh:mm:ss i titellinjen):
Dim hh As Integer
Dim mm As Integer
Dim ss As Integer
hh = Int(player.CurrentPosition / 3600)
mm = Int((player.CurrentPosition - (hh * 3600)) / 60)
ss = Int(player.CurrentPosition - (mm * 60))
' Viser hh:mm:ss i titellinjen
Me.Caption = Format2(hh) & ":" & Format2(mm) & ":" & Format2(ss)
' Funktion til at vise 1 som 01 osv. (sætter et ekstra nul foran tal < 10)
Public Function Format2(ByVal strText)
If Len(strText) < 2 Then
strText = "0" & strText
End If
Format2 = strText
End Function
/Martin Sommer
www.magik.dk