vb 播放器进度条问题
发布网友
发布时间:2024-02-02 01:04
我来回答
共3个回答
热心网友
时间:2024-11-16 18:11
Dim S As Single, P As Integer, K As Single
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 1000 / 3
ProgressBar1.Max = 100
ProgressBar1.Align = 0
ProgressBar1.Scrolling = ccScrollingSmooth
S = S '歌曲或视频播放长度
S1 = S
K = S / 100
End Sub
Private Sub Timer1_Timer()
P = P + 1
S1 = S1 - 1000 / 3
If S1 > 0 Then
Timer1.Enabled = True
ProgressBar1.Value = ProgressBar1.Value + K
Else
Timer1.Enabled = False
End If
End Sub
热心网友
时间:2024-11-16 18:12
刚好我正在用vb自己画了个进度条
9570-180=9390 是进度条的总长度
9350/s 是 播放每秒所对应的进度条,再除以3就是每次运行timer所需要移动的进度条宽度(也就是left需要增加的)
热心网友
时间:2024-11-16 18:12
(9570-180)/S/3