开发者

stopping and starting for each loop array in visual basic

开发者 https://www.devze.com 2022-12-21 19:47 出处:网络
i have a for each loop i.e For Each dgvRow In boutgrid.Rows file = dgvRow.Cells(\"FileName\").Value AxWindowsMediaPlayer1.url = file开发者_运维问答

i have a for each loop i.e

For Each dgvRow In boutgrid.Rows
file = dgvRow.Cells("FileName").Value
AxWindowsMediaPlayer1.url = file开发者_运维问答
AxWindowsMediaPlayer1.Ctlcontrols.play()
Next

if want that the loop stops while the player play a file until finished playback


Just doing some Googlefoo on the AXWindowsMediaPlayer class, you ought to be able to get the duration. The AxWindowsMediaPlayer class has a currentMedia field which has a get_duration member which returns the duration in seconds.

Then call System.Threading.Thread.Sleep(Duration * 1000) because the get_duration returns seconds, and Thread.Sleep is in miliseconds.

0

精彩评论

暂无评论...
验证码 换一张
取 消