作者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/cn.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