作者seclusive (the farest path)
看板Visual_Basic
標題[.NET] 在MDI內重複開啟影片
時間Wed May 7 11:35:53 2014
請輸入專案類型(網站專案或者應用程式專案):VB.NET
目前想寫出來的功能是
間格時間timer1後啟動video來呼叫media player播放影片
以及啟動words來呼叫字幕
在按下button1後過timer2後會再次啟動timer1
並重複撥放影片跟字幕
但我目前第一次撥放OK
但timer2啟動timer1後
卻無法成功呼叫video跟words來撥放
不知道問題是卡在哪邊 >"<
還煩請各位前輩指教 m(_ _)m
Public Class SaveScreen
Dim count1 As Integer = 0 '計算timer1次數
Dim count2 As Integer = 0 '計算timer2次數
Dim Video As New MediaPlayer 'Call Mediaplayer播放
Dim words As New Labeluse
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Video.MdiParent = Me
words.MdiParent = Me
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
MessageBox.Show("Timer1 started")
Timer1.Enabled = False
Video.Show()
words.Show()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Video.Close()
words.Close()
PictureBox1.Image = Image.FromFile("C:\Users\Adrian\Desktop\DSC_0001.jpg")
Timer2.Enabled = True
MessageBox.Show("Timer2 start, plz wait 5 seconds.")
End Sub
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
MessageBox.Show("Timer2 started.")
Timer2.Enabled = False
Timer1.Enabled = True
MessageBox.Show("Timer1 start, plz wait 5 seconds.")
End Sub
End Class
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.240.66.241
※ 文章網址: http://webptt.com/m.aspx?n=bbs/Visual_Basic/M.1399433755.A.B11.html
1F:推 johnpage:timer1沒有在計數 05/07 13:05
2F:→ seclusive:Sorry忘了把最上面兩行刪掉 我沒有要計次 ^^" 05/07 14:13
3F:推 johnpage:不是這問提,請仔細看timer的使用方式 05/07 14:35